Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

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


Ïà¹ØÎĵµ£º

ASP.NET·ÀÖ¹±íµ¥Öظ´Ìá½»½â¾ö°ì·¨ËѼ¯

 
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

ʾÀý
µÚÒ»¸öʾÀýÑÝʾÈçºÎ´´½¨ FileUpload ¿Ø¼þ£¬¸Ã¿Ø¼þ½«Îļþ±£´æµ½´úÂëÖÐÖ¸¶¨µÄ·¾¶¡£
<%@ Page Language="C#" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<script runat="server">
  ......

ASP.NET

Îå¡¢ImageMap Àà
      ʹÓà ImageMap ¿Ø¼þ¿ÉÒÔ´´½¨°üº¬¶¨ÒåµÄ×÷ÓõãÇøÓòµÄͼÏñ¡£µ±Óû§µ¥»÷×÷ÓõãÇøÓòʱ£¬´Ë¿Ø¼þ¿ÉÒÔÉú³Éµ½·þÎñÆ÷µÄ»Ø·¢£¬Ò²¿ÉÒÔµ¼º½µ½Ö¸¶¨µÄ URL¡£ÀýÈ磬¿ÉÒÔʹÓô˿ؼþÏÔʾһ·ùµØÀíÇøÓòµÄµØͼ¡£Óû§µ¥»÷¸ÃµØͼÉϵÄÌض¨ÇøÓòʱ£¬´Ë¿Ø¼þ¾Íµ¼º½µ½Ò»¸ö URL£¬¸Ã URL ÌṩÁËÑ¡¶¨ÇøÓòµ ......

ASP.NETÑéÖ¤¿Ø¼þÏê½â

 
ASP.NET
¹«ÓÐÁùÖÖÑéÖ¤¿Ø¼þ£¬·Ö±ðÈçÏ£º
 
RequiredFieldValidator
£¨±ØÐë×Ö¶ÎÑéÖ¤£© ÓÃÓÚ¼ì²éÊÇ·ñÓÐÊäÈëÖµ
CompareValidator
£¨±È½ÏÑéÖ¤£© °´É趨±È½ÏÁ½¸öÊäÈë
RangeValidator
£¨·¶Î§ÑéÖ¤£© ÊäÈëÊÇ·ñÔÚÖ¸¶¨·¶Î§
RegularExpressionValidator
£¨ÕýÔò±í´ïʽÑéÖ¤£© ÕýÔò±í´ïʽÑéÖ¤¿Ø¼þ
CustomValid ......

asp.netʵÏÖα¾²Ì¬


webconfigα¾²Ì¬
<system.web>
<httpHandlers>
<add verb="*" path="*.aspx" type="URLRewriter.RewriterFactoryHandler, URLRewriter"/>
<add verb="*" path="*.html" type="URLRewriter.RewriterFactoryHandler, URLRewriter"/>
</httpHandlers>
</system.web> ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ