ASP.NETÖзÀÖ¹Ò³Ãæ¶à´ÎÌá½»µÄ´úÂëʵÏÖ
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.Button3.Click += new System.EventHandler(t
Ïà¹ØÎĵµ£º
<mce:script language=javascript><!--
//×¢²áÃüÃû¿Õ¼ä
Type.registerNamespace("Demo");
Demo.Message=function(content,publishTime)
{
this._content = content;
this._publishTime = publishTime;
}
Dem ......
OnClientClick="this.disabled=true;this.form.submit();" UseSubmitBehavior="False"ÔÚ°´Å¥ÊôÐÔÖмÓÈëÕâ¶Î´úÂë
this.btnSubmit.Attributes["onclick"] = this.GetPostBackEventReference(this.btnSubmit) + ";this.disabled=true;";
Èç¹ûÊÇÌá½»ÊÇÒ»¸öButton£¬¿ÉÒÔʹÓÃjavascript£¬ÉèÖÃΪen ......
¾¹ý¶Ôasp.netµÄѧ£¬ÎÒ¾õµÃÔ½À´Ô½Á¦²»´ÓÐÄ°¡£¡ËµÊµ»°ÎÒÏÖÔÚ¶¼²»¸Ò˵×Ô¼ºÒѾÈëÃÅÁË£¡ÓÐʱºòÕæÏ룬ÎÒµ½µ×Êʺϲ»ÊʺÏѧÕâ¸ö£¬ÎÒ²¢²»ÊÇÓöµ½À§ÄѾÍÏëÌӱܣ¬Ö»ÊÇÎÒÕÒ²»µ½ºÏÊʵķ½·¨À´½â¾ö×Ô¼ºÓöµ½µÄÎÊÌâ¡£¶¼ËµÇ§ÄêÄ¥Ò»½££¬ÏÖÔÚ²ÅÕæÕýÈÏʶµ½£¬ÏëÒªµÃµ½µã¶ù¶«Î÷£¬Ã»Óе㸶³öºÍÎþÉüÊÇ¿ÉÄܵÄÊ£¡
&n ......
×öÏîÄ¿Ò²ÓÐÒ»¶Îʱ¼äÁË£¬ÔÚ³ÌÐòÖÐÒ²Óöµ½ºÜ¶à°²È«·½ÃæµÄÎÊÌâ¡£Ò²¸Ã×ܽáÒ»ÏÂÁË¡£Õâ¸öÏîÄ¿ÊÇÒ»¸ö CMS ϵͳ¡£ÏµÍ³ÊÇÓà ASP.NET ×öµÄ¡£¿ª·¢µÄʱºò·¢ÏÖ΢Èí×öÁ˺ܶలȫ´ëÊ©£¬Ö»ÊÇÓÐЩÐÂÊÖ³ÌÐòÔ±²»ÖªµÀÔõô¿ªÆô¡£ÏÂÃæÎÒͨ¹ý¼¸¸ö·½Ãæ¼òµ¥½éÉÜ£º
¡¡¡¡1£ºSQL ×¢Èë
¡¡¡¡2£ºXSS
¡¡¡¡3£ºCSRF
¡¡¡¡4£ºÎļþÉÏ´«
SQL ×¢Èë
¡¡¡¡Ò ......
Îå¡¢ImageMap Àà
ʹÓà ImageMap ¿Ø¼þ¿ÉÒÔ´´½¨°üº¬¶¨ÒåµÄ×÷ÓõãÇøÓòµÄͼÏñ¡£µ±Óû§µ¥»÷×÷ÓõãÇøÓòʱ£¬´Ë¿Ø¼þ¿ÉÒÔÉú³Éµ½·þÎñÆ÷µÄ»Ø·¢£¬Ò²¿ÉÒÔµ¼º½µ½Ö¸¶¨µÄ URL¡£ÀýÈ磬¿ÉÒÔʹÓô˿ؼþÏÔʾһ·ùµØÀíÇøÓòµÄµØͼ¡£Óû§µ¥»÷¸ÃµØͼÉϵÄÌض¨ÇøÓòʱ£¬´Ë¿Ø¼þ¾Íµ¼º½µ½Ò»¸ö URL£¬¸Ã URL ÌṩÁËÑ¡¶¨ÇøÓòµ ......