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);
}
/// < summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// < /summary> private void InitializeComponent()
{
this
Ïà¹ØÎĵµ£º
ѧϰ×Ô¶¨Òå¿Ø¼þµÄ¿ª·¢²»½ö¿ÉÒÔʹÄ㿪·¢³ö¸üÁé»îµÄϵͳ¸üÖØÒªµÄÊÇËü¿ÉÒÔʹÄã¼ÓÉî¶ÔÒÑÓзþÎñÆ÷¿Ø¼þµÄÀí½â£¬µÃÒÔ¸üÁé»îµÄÓ¦Óá£
½ÏÖ®ÓÚasp£¬asp.netÌṩÁ˸üÇ¿´óµÄ¹¦ÄÜ£¬ÎұȽÏϲ»¶ËüµÄ´úÂë·ÖÀë¼¼ÊõºÍ¶ÔÖîÈçC#¡¢VB.NetµÈÇ¿ÀàÐÍÓïÑÔµÄʹÓã¬ÕâÊÇ´Ó¿ª·¢ÕߵĽǶÈÀ´¿´µÄ£¬´ÓÓû§µÄ½Ç¶ÈÀ´¿´£¬»á¾õµÃËüËٶȸü¿ì£¬ÔËÐиüÎȶ¨£¬ ......
<HTML><HEAD>
<TITLE>ÍøÒ³ÌØЧ¹ÛÖ¹|JsCode.CN|---Ò³ÃæÓÒϽǵ¯³öÀàËÆQQ»òMSNµÄÏûÏ¢Ìáʾ</TITLE>
<SCRIPT language=JavaScript>
<!--
/**//*
** ==================================================================================================
**&nbs ......
asp.net ѧϰ×ÊÔ´
¹ØÓÚ´ËÖ÷Ìâ½öÓÐ 1 ¸öÌû×Ó - Ê÷ʽä¯ÀÀ
astin...@gmail.com
9ÔÂ26ÈÕ ÉÏÎç12ʱ41·Ö ÏÔʾѡÏî
·¢¼þÈË£º astin...@gmail.com - ²éÕÒ´Ë×÷ÕßµÄÌû×Ó
ÈÕÆÚ£ºSun, 25 Sep 2005 09:41:54 -0700
µ±µØʱ¼ä£º2005Äê9ÔÂ26ÈÕ(ÐÇÆÚÒ») ÉÏÎç12ʱ41·Ö
Ö÷Ì⣺asp.net ѧϰ×ÊÔ´
´ð¸´×÷Õ ......
Ч¹ûͼ£º
ǰ̨´úÂ룺
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="OWCdrawing.aspx.cs" Inherits="OWCdrawing" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xh ......
1£®URL´«Öµ
ÕâÊǾµäµÄ´«Öµ·½Ê½£¬ÕâÖÖ·½·¨µÄʹÓ÷dz£¼òµ¥£¬²»¹ýËù´«µÝµÄÖµÊÇ»áÏÔʾÔÚä¯ÀÀÆ÷µÄµØÖ·À¸Éϵģ¬¶øÇÒ²»ÄÜ´«µÝ¶ÔÏó¡£ËùÒÔÕâÖÖ·½·¨Ò»°ãÓÃÓÚ´«µÝµÄÖµÉÙÇÒ°²È«ÐÔÒªÇ󲻸ߵÄÇé¿öÏ¡£ÔÚ*.aspxÒ³Ã濪·¢ÖпÉÒÔʹÓ󬼶Á´½ÓÎı¾½øÐд«Öµ
2£®Session´«Öµ
ÕâÖÖ·½·¨½«Ã¿·ÝÊý¾Ý´æ´¢ÓÚ·þÎñÆ÷±äÁ¿ÖУ¬¿ÉÒÔ´«µÝ±È½Ï¶àµÄÊý¾Ý£¬²¢ ......