ASP.NETÖзÀÖ¹Ò³Ãæ¶à´ÎÌá½»µÄ´úÂëʵÏÖ
1.
´Ë´¦ÌṩµÄ´úÂëÓÃÀ´ÊµÏÖµ±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
/
Ïà¹ØÎĵµ£º
ÔÚASP.NETÖУ¬Îļþ´¦ÀíµÄÕû¸ö¹ý³Ì¶¼ÊÇΧÈÆ×ÅSystem.IO Õâ¸öÃû³Æ¿Õ¼äÕ¹¿ªµÄ¡£Õâ¸öÃû³Æ¿Õ¼äÖоßÓÐÖ´ÐÐÎļþ¶Á¡¢Ð´ËùÐèÒªµÄÀà¡£±¾ÎÄ´Ó×î»ù±¾µÄ²Ù×÷¿ªÊ¼£¬½âÊÍÔÚASP.NETÖÐÎļþ´¦ÀíµÄ¸ÅÄ°üÀ¨Èç´ÓÒ»¸öÎļþÖжÁÈ¡ÄÚÈÝ¡¢ÈçºÎÏòÒ»¸öÎļþÖÐдÈëÄÚÈݺÍÈçºÎɾ³ýÒ»¸öÎļþ¡£¡¡¡¡
Ç°ÃæÒѾÌáµ½£¬ÒªÏëÔÚASP.NET Ò³ÃæÖнøÐÐÎļþ´¦Àí£¬±ØÐ ......
1.ÉÏ´«¹¦ÄÜ
JS¼ì²é
function hideUpImg()//¹Ø±Õ²ã£¬²¢ÉÏ´«Í¼Æ¬
{
var v=document.getElementById("upImg").value;
var after=v.substring(v.lastIndexOf('.')).toLowerCase();
alert(after);
if(v.length<=0)
{
alert("ÇëÑ¡ÔñͼƬ");
return ......
ÎÄÕ³ö´¦£ºhttp://www.cnblogs.com/tomcat112906/articles/922639.html
ASP.NETµÄHTMLTableÔÑùµ¼³öµ½Excel
js´úÂë £º function PrintTableToExcelEx(objTab)
{
&nbs ......
µÚÒ»ÖÖ·½·¨ÊǶÔÒ»¸öaspxÒ³ÃæÉú³ÉhtmlÎļþ£¬ÏȶԷþÎñÆ÷·¢ËÍÇëÇóaspxÒ³Ã棬ȡ·þÎñÆ÷·µ»ØµÄhtmlÁ÷£¬Ð´µ½Ò»¸öhtmlÎļþÀaspxÒ³ÃæÏÔʾµÄÊÇʲô£¬Éú³ÉµÄhtmlÒ³Ãæ¾ÍÊÇʲô
£±¡¢asp·½·¨£º
sub createHTML
dim xmlhttp,strhtml,objAdoStream,i,myurl
set xmlhttp=server.CreateObject("Microsoft.XMLHTTP")
&nb ......
ÓÃDataBinder.eval °ó¶¨Êý¾Ý²»±Ø¹ØÐÄÊý¾ÝÀ´Ô´(Dataread»òdataset)Ò²²»±Ø¹ØÐÄÊý¾ÝµÄÀàÐÍ,eval»á°ÑÕâ¸öÊý¾Ý¶ÔÏóת»»ÎªÒ»¸ö×Ö·û´®¡£Êǵײã°ó¶¨×öÁ˺ܶ๤×÷£¬Ê¹ÓÃÁË·´ÉäÐÔÄÜ¡£ÕýÒòΪʹÓ÷½±ãÁË£¬µ«È´Ó°ÏìÁËÊý¾ÝÐÔÄÜ¡£µ±Óëdataset°ó¶¨Ê±£¬DataItemÆäʵÊÇÒ»¸öDataRowView£¨Èç¹û°ó¶¨µÄÊÇÒ»¸öÊý¾Ý¶ÁÈ¡Æ÷£¨dataread£©Ëü¾ÍÊÇÒ»¸öIdat ......