ASP.NETÖÐÔÚµã»÷°´Å¥ºó½«¸Ã°´Å¥ÉèΪ²»¿ÉÓõÄÈô¸ÉÇé¿ö
ÔÎÄ£ºÁõÎä|ASP.NETÖÐÔÚµã»÷°´Å¥ºó½«¸Ã°´Å¥ÉèΪ²»¿ÉÓõÄÈô¸ÉÇé¿ö
ÏîÄ¿Öо³£³öÏÖÓû§Öظ´Ìá½»µÄÇé¿ö£¬ÎªÁË·ÀÖ¹ÕâÖÖÇé¿ö£¬×î³£Óõķ½·¨¾ÍÊÇÔÚÓû§µã»÷°´Å¥ºó½«¸Ã°´Å¥ÉèΪ²»¿ÉÓ㬱ÊÕßÔÚʵ¼Ê¿ª·¢µ±ÖÐÓöµ½Á˶àÖÖ²»Í¬µÄÇé¿ö£¬ÔÚ´Ë×ö¸öС½á£¬ÒÔ¹©²Î¿¼¡£
µÚÒ»ÖÖÇé¿öÊÇ·ÇsubmitÀàÐ͵İ´Å¥
ÕâÖÖÇé¿ö±È½Ï¼òµ¥£¬Ö»ÒªÔÚ¿Í»§¶ËÌí¼Óʼþ£¬½«°´Å¥ÉèΪ²»¿ÉÓþͿÉÒÔÁË¡£¿´ÏÂÃæµÄ´úÂ룺
ASP.NET-Code:
<form id="form1" runat="server">
<asp:Label ID="lbl" runat="server"></asp:Label>
<asp:Button ID="btn" runat="server" Text="Test"
OnClick="btn_Click" OnClientClick="this.disabled=true"
UseSubmitBehavior="false" />
</form>
C#-Code:
protected void btn_Click(object sender, EventArgs e)
{
System.Threading.Thread.Sleep(1000);
lbl.Text = DateTime.Now.ToString();
}
µÚ¶þÖÖÇé¿öÊÇsubmitÀàÐ͵İ´Å¥
´ËʱµÚÒ»ÖÖ·½·¨¾Í²»ÐÐÁË£¬°´Å¥±»ÉèΪDISABLEDÖ®ºó¾ÍÎÞ·¨Íê³ÉÌá½»£¬ÎÒÃÇ¿ÉÒÔÊʵ±Ð޸ĴúÂ룺
ASP.NET-Code:
<form id="form1" runat="server">
<asp:Label ID="lbl" runat="server"></asp:Label>
<asp:Button ID="btn" runat="server" Text="Test"
OnClick="btn_Click"/>
</form>
C#-Code:
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
btn.OnClientClick = "this.disabled=true;" +
GetPostBackEventReference(btn);
}
}
ÓëµÚÒ»ÖÖ·½·¨²»Í¬µÄÊÇÎÒÃÇÔÚPage_LoadÖиø°´Å¥Ìí¼Ó¿Í»§¶Ëʼþ£¬²¢¸½¼ÓÁËGetPostBackEventReference¡£µ«ÕâÑù×ö»¹ÓиöȱÏÝ£¬ÔÚµÚÒ»Ìá½»»Ø·¢Íê³ÉÒÔºó£¬ÔÙµã»÷°´Å¥¾Í»áʧ°Ü£¬Òò´ËÎÒÃÇÐèҪȥµôif (!Page.IsPostBack)Õâ¾ä£¬Ò²¾ÍÊÇÿ´Î»Ø·¢¶¼Ò
Ïà¹ØÎĵµ£º
ÔÚÎÒÃÇ´«Í³µÄÍøÕ¾½¨ÉèÖÐͨ³£ÊÇÏÈÉè¼ÆÍøÕ¾Ò³Ã棬ÔÙÀûÓÿª·¢¹¤¾ß£¬ÔÚÍøÕ¾µÄ¿ò¼ÜÄÚ½øÐй¦ÄÜÉè¼Æ¡£ÕâÑùµÄÍøÕ¾½¨Éè´æÔںܶà±×¶Ë£¬ÆäÖÐ×îÍ»³öµÄȱµãÊDz»ÀûÓÚС×鹲ͬ¿ª·¢£¬¸÷»·½ÚÖ®¼äÒÀÀµÐÔÌ«Ç¿¡£
ÔÚASP.NETÖÐÎÒÃÇ¿ÉÒÔÀûÓúǫ́±àÂ룬°ÑHTMLÓû§½çÃæÉè¼Æ£¨ÑÕÉ«¡¢ÃÀѧµÈ£©ÓëÒ³Ãæ´úÂëÇø·Ö¿ªÀ´¡£ÕâÑù¾Í¿ÉÒÔ½â¾öÎÒÃÇС×éµÄ²¢Ðпª·¢ÎÊ ......
Õû¸öSQLºÍAsp.net(vb.net)Ò»Æð´ò°üµÄÈ«¹ý³ÌдһÏ¡£
Ò».×¼±¸±ØÒªµÄÎļþ
1. SQL½Å±¾Îļþ£¬Éú³ÉÒÔºó°²×°¹ý³ÌÖÐÐèÒªµÄ±íºÍ´æ´¢¹ý³ÌµÈµÈ£»
Éú³ÉÖ®ºó£¬¾ÍÔÝʱ°ÑËüÃüÃûΪdb.sql(×¢Òâ´óСд)
2.LisenceFile.rtfµÄ°²×°Îļþ£¬ÒòΪÎÒµÄϵͳÊǸöÈ˵ģ¬¶øÇÒfreeµÄ£¬ËùÒÔ¾ÍûÓÐ×ö¡£Õâ¸öÒÔºóÒ²ÊÇÒªÓõ½µÄ¡£
¶þ.ÔÚ×Ô¼ºÏÖÓеÄÏîÄ¿Àïà ......
ÔÚweb¿ª·¢ÖÐ,¾³£ÒªÓõ½¿Ø¼þµÄOnClientClickÓëOnClickʼþ.
Èç¹ûʹÓò»µ±,¾³£»áÓöµ½Ò»Ð©ÒâÁÏÖ®ÍâµÄÊÂÇé·¢Éú,ÈÃÈËÃþ²»×ÅÍ·ÄÔ.ÏÂÃæ¾Í½«ÎÒµÄһЩСС×ܽáµÀÀ´:
Ê×ÏÈÎÒÃÇÒªÁ˽âÕâÁ½¸öʼþ:
OnClientClickÊÇ¿Í»§¶Ëʼþ·½·¨.Ò»°ã²ÉÓÃJavaScriptÀ´½øÐд¦Àí.Ò²¾ÍÊÇÖ±½ÓÔÚIE¶ËÔËÐÐ.Ò»µã»÷¾ÍÔËÐÐ.
OnClickʼþÊÇ·þÎñÆ÷¶Ëʼþ´¦Àí ......
ûÓÐ×ÐϸÑо¿¹ýViewState£¬×î½ü³öÏÖµÄÎÊÌâÈÃÈËÍ·Í´²»ÒÑ¡£
ViewState»áÔÚijЩÌض¨Çé¿öÏÂÏûʧ£¬ÇÒºÜÄѲ¶×½µ½¡£²éÁËһЩ¼¼ÊõÎÄÕ£¬¶¼ÊÇ˵ViewStateµÄ»úÖÆÊǽ«ÐÅÏ¢´æÔÚÒ³ÃæµÄhidden inputÀïÃ棬Ëƺõ²»¿ÉÄÜ´æÔÚÕâЩÎÊÌ⣬¸ø³öµÄÀíÓÉÎÞ·ÇÊÇÔÚij¸öµØ·½±»Ä³¸ö²»Ð¡ÐĵijÌÐòÔ±¸ø½ûµô»òÇå³ýµôÁ ......
default.aspx.cs
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls. ......