ASP.NETÖзÀÖ¹Ò³Ãæ¶à´ÎÌá½»µÄ´úÂëʵÏÖ
´Ë´¦ÌṩµÄ´úÂëÓÃÀ´ÊµÏÖµ±asp.netÒ³ÃæÖеÄij¸öButton±»µã»÷ºódisableµô¸ÃÒ³ÃæÖÐËùÓеÄButton£¬´Ó¶ø·ÀÖ¹Ìá½»ÑÓʱµ¼ÖµĶà´ÎÌá½»¡£»ùÓÚ֮ǰµÄonceclickbutton½Å±¾.
//ASP.NETÖзÀÖ¹Ò³Ãæ¶à´ÎÌá½»µÄ´úÂë:javascript< script language="javascript"> < !-- function disableOtherSubmit() {
var obj = event.srcElement;
var objs = document.getElementsByTagName('INPUT');
for(var i=0; i< objs.length; i++)
{
if(objs[i].type.toLowerCase() == 'submit')
{
objs[i].disabled = true;
}
}
} //--> < /script>//ASP.NETÖзÀÖ¹Ò³Ãæ¶à´ÎÌá½»µÄ´úÂë:asp.netpublic class PreventMultiClick : System.Web.UI.Page {
protected System.Web.UI.WebControls.Button Button1; protected System.Web.UI.WebControls.Button Button2;
protected System.Web.UI.WebControls.LinkButton LinkButton1; protected
System.Web.UI.WebControls.Button Button3; private void Page_Load(object
sender, System.EventArgs e)
{
this.GetPostBackEventReference(this.Button3);
//±£Ö¤ __doPostBack(eventTarget, eventArgument) ÕýÈ·×¢²á if(!IsPostBack)
{
System.Text.StringBuilder sb = new System.Text.StringBuilder();
sb.Append("if (typeof(Page_ClientValidate) == 'function')
{
if (Page_ClientValidate() == false)
{
return false;
}
}"); //±£Ö¤ÑéÖ¤º¯ÊýµÄÖ´ÐÐ sb.Append("if(window.confirm('are you sure?')==false) return false; ");
//×Ô¶¨Òå¿Í»§¶Ë½Å±¾ sb.Append("disableOtherSubmit(); ");
// disableËùÓÐsubmit°´Å¥ sb.Append(this.GetPostBackEventReference(this.Button3));
//ÓÃ__doPostBackÀ´Ìá½»£¬±£Ö¤°´Å¥µÄ·þÎñÆ÷¶ËclickʼþÖ´ÐÐ sb.Append("; ");
Button3.Attributes.Add("onclick",sb.ToString());
}
} #region Web Form Designer generated code override protected void OnInit(EventArgs e)
{
// // CODEGEN: This call is required by the ASP.NET Web Form Designer. // InitializeComponent();
base.OnInit(e);
Ïà¹ØÎĵµ£º
´Ë´¦ÌṩµÄ´úÂëÓÃÀ´ÊµÏÖµ±asp.netÒ³ÃæÖеÄij¸öButton±»µã»÷ºódisableµô¸ÃÒ³ÃæÖÐËùÓеÄButton£¬´Ó¶ø·ÀÖ¹Ìá½»ÑÓʱµ¼ÖµĶà´ÎÌá½»¡£»ùÓÚ֮ǰµÄonceclickbutton½Å±¾.
//ASP.NETÖзÀÖ¹Ò³Ãæ¶à´ÎÌá½»µÄ´úÂë:javascript< script language="javascript"> < !-- function disableOtherSubmit() {
var obj = event.srcElem ......
ASP.NET Web »º´æÔöÇ¿ÐÔÄܺͿÉÉìËõÐÔ
¸ÅÀÀ£º
Æ¿¾±ÏÞÖÆÏÔÖø½µµÍ
¾²Ì¬ºÍ¶¯Ì¬ Web »º´æ
±Ø±¸µÄ¹¦ÄÜ£º¹ýÆÚ¡¢Êý¾Ý¿âÒÀÀµ¹Øϵ¡¢PDF ²¿·ÖÄÚÈÝÒÔ¼°¸ü¶à¹¦ÄÜ
¶ÔÈ«Çò×éÖ¯µÄÌØÊâºÃ´¦
Web »º´æ·þÎñÆ÷Ⱥ¼¯
Ãâ·ÑºÍÉÌÓýâ¾ö·½°¸
Contents
ÎÊÌ⣺ASP.NET Æ¿¾±ÏÞÖÆ
½â¾ö·½°¸£ºASP.NET Web »º´æ
Web »º´æÖ ......
ÔÌûµØÖ·£ºhttp://www.wangchao.net.cn/bbsdetail_572426.html
¼ò½é
¡¡¡¡ÓÐÐí¶à´ÏÃ÷µÄ°ì·¨¿ÉÒÔ½â¾öHTTPÐÒéµÄÎÞ״̬ÎÊÌ⣬ÀýÈç¶Ôÿ¸öÇëÇóÖظ´·¢ËÍÓ¦ÓóÌÐòÊý¾Ý°ü¡¢Ê¹ÓÃHTTPÈÏÖ¤»úÖÆÀ´½«ÇëÇóÓ³Éäµ½Ìض¨µÄÓû§¡¢Ê¹ÓÃCookieÀ´´æ´¢Ò»ÏµÁÐÇëÇóµÄ״̬µÈ¡£ÔÚASP.net¼¼ÊõÖÐÌṩÁË ......
Àý×Ó£º
using system.web.caching
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SqlClient" %>
<html>
<script language="C#" runat="server">
void Page_Load(Object Src, EventArgs E) {
DataView Source;
// Retrieve the DataView obj ......
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
usin ......