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.Button3.Click += new System.EventHandler(this.Button3_Click); this.Load += new System.EventHandler(this.Page_Load);
}
#endregion private void Button3_Click(object sender, System.EventArgs
Ïà¹ØÎĵµ£º
1. ¼òÊö private¡¢ protected¡¢ public¡¢ internal ÐÞÊηûµÄ·ÃÎÊȨÏÞ¡£
´ð . private : ˽ÓгÉÔ±, ÔÚÀàµÄÄÚ²¿²Å¿ÉÒÔ·ÃÎÊ¡£
protected : ±£»¤³ÉÔ±£¬¸ÃÀàÄÚ²¿ºÍ¼Ì³ÐÀàÖпÉÒÔ·ÃÎÊ¡£
public : ¹«¹²³ÉÔ±£¬ÍêÈ«¹«¿ª£¬Ã»ÓзÃÎÊÏÞÖÆ¡£
internal: ÔÚͬһÃüÃû¿Õ¼äÄÚ¿ÉÒÔ·ÃÎÊ¡£
2 .ÁоÙASP.NET Ò³ÃæÖ®¼ä´«µÝÖµµÄ¼¸ÖÖ·½ ......
¹ØÓÚÒ³Ãæ´«ÖµµÄ·½·¨£¬Òý·¢Á˺ܶàÌÖÂÛ¡£¿´À´ÓкܶàÈ˹Ø×¢Õâ¸ö£¬ÎÒ¾ÍÎÒ¸öÈ˹۵ã×öÁËЩ×ܽᣬϣÍû¶Ô´ó¼ÒÓÐËù°ïÖú¡£
1. ʹÓÃQueryString±äÁ¿
QueryStringÊÇÒ»Öַdz£¼òµ¥µÄ´«Öµ·½Ê½£¬Ëû¿ÉÒÔ½«´«Ë͵ÄÖµÏÔʾÔÚä¯ÀÀÆ÷µÄµØÖ·À¸ÖС£Èç¹ûÊÇ´«µÝÒ»¸ö»ò¶à¸ö°²È«ÐÔÒªÇ󲻸߻òÊǽṹ¼òµ¥µÄÊýֵʱ£¬¿ÉÒÔʹÓÃÕâ¸ö·½·¨¡£µ«ÊǶÔÓÚ´«µÝ ......
À´ÕÒÕâƪÎÄÕµÄ,Ó¦¸Ã¶¼ÖªµÀʲô½Ð¶þ¼¶ÓòÃû°É,·Ï»°¾Í²»ËµÁË.µ«ÊÇÌÖÂÛÇ°,ÏÈÒªÃ÷°×Ò»¸ö˼ÏëÎÊÌâ.
ºÜ¶àÅóÓÑÒ»Ö±¿¼ÂDz»Çå(ÎÒÇ°¼¸ÌìÒ²Ò»Ö±¸ã²»Ã÷°×)µÄÎÊÌâÊÇ,ÎÒ¼üÈëÒ»¸öµØÖ·ºó,ÔõôÕâ¸öurl¾Í±»ÖØдÁË?
µÚÒ»²½:ÔÚä¯ÀÀÆ÷¼üÈëÁËÒ»¸öµØÖ·,±ÈÈçhttp://love.kerry.com,µã»Ø³µºó,¶¼·¢ÉúÁËʲô?
ΪÁË°ÑÎÊÌâ¼òµ¥»¯,ÎÒÀ´ÕâÑù½âÊÍ:
µÚ¶þ² ......
2009-12-03
1. ¼òÊö private¡¢ protected¡¢ public¡¢ internal ÐÞÊηûµÄ·ÃÎÊȨÏÞ¡£
´ð . private : ˽ÓгÉÔ±, ÔÚÀàµÄÄÚ²¿²Å¿ÉÒÔ·ÃÎÊ¡£
protected : ±£»¤³ÉÔ±£¬¸ÃÀàÄÚ²¿ºÍ¼Ì³ÐÀàÖпÉÒÔ·ÃÎÊ¡£
public : ¹«¹²³ÉÔ±£¬ÍêÈ«¹«¿ª£¬Ã»ÓзÃÎÊÏÞÖÆ¡£
internal: ÔÚͬһÃüÃû¿Õ¼äÄÚ¿ÉÒÔ·ÃÎÊ¡£
2 .ÁоÙASP.NET Ò³ÃæÖ®¼ä´«µÝÖµµÄ ......
Ê×ÏÈÊý¾Ý¿â±íµÄÉè¼Æµ±ÖÐ
×¢²áÓû§±íÓ¦¸Ã°üº¬Ò»¸öÊÇ·ñ¼¤»îµÄ×ֶΣ¬Í¨¹ý´Ë×Ö¶ÎÀ´ÅжÏÊÇ·ñ¼¤»î¡£ºÍÒ»¸ö¼¤»îkeyµÄ×ֶΣ¬´Ë×Ö¶ÎÓÃÓÚ·ÅÖü¤»îÂë
³ÌÐò·½Ãæ
ÔÚÓû§×¢²áµÄʱºòËæ»úÉú³ÉÒ»¸ö¼¤»îÂë(ÇëÈ·±£¼¤»îÂëΨһ)£¬°ÑÓû§ÐÅÏ¢¼°¼¤»îÂë²åÈëµ½Êý¾Ý±íÖС£
ͨ¹ý·¢ÓʼþµÄ·½Ê½Ïò×¢²áÓû§ÌṩµÄÓÊÏä·¢Ò»·â°üº¬¼¤»îÁ´½ÓºÍ¸Õ¸ÕÉú³ÉµÄ¼¤» ......