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

ASP.NETÒ³ÃæÉúÃüÖÜÆÚÃèÊö

תÔØһƪ¹ØÓÚASP.NETÒ³ÃæÉúÃüÖÜÆÚÎÄÕÂ,ÓбØÒªÁ˽âÒÅÒ»ÏÂÒ³Ãæ³õʼ¹ý³Ìµ½µ×ÊÇÔõôÑùµÄ
ÏÂÃæÊÇASP.NETÒ³Ãæ³õʼµÄ¹ý³Ì:
1. Page_Init();
2. Load ViewState;
3. Load Postback data;
4. Page_Load();
5. Handle control events;
6. Page_PreRender();
7. Page_Render();
8. Unload event;
9. Dispose method called;
ÏÂÃæ¶ÔÆäÖеÄһЩ¹ý³Ì×÷ÏÂÃèÊö£º
1. Page_Init();
Õâ¸ö¹ý³ÌÖ÷ÒªÊdzõʼ»¯¿Ø¼þ,ÿ´ÎÒ³ÃæÔØÈëÖ´ÐÐÕâ¸ö³õʼ¹ý³Ì,°üÀ¨µÚÒ»´ÎºÍÒÔºóµÄPostback(ÕâÀï˵ÏÂPostback,Æäʵ¾Í¿ÉÒÔ¼òµ¥Àí½â³ÉÓû§µã
»÷SUBMIT°´Å¥Ö®ÀàµÄ,°Ñ±íµ¥<Form>Ìá½»¸ø·þÎñÆ÷,Õâ¾ÍÊÇÒ»´Îpostback),ÔÚÕâÀïÃæ¿ÉÒÔ·ÃÎʿؼþ,µ«ÊÇÕâÀïÃæµÄ¿Ø¼þÖµ²»ÊÇÎÒÃÇÆÚ´ýµÄ¿Ø¼þÀïÃæ
µÄÖµ,ËûÖ»ÊÇÒ»¸ö¿Ø¼þµÄ³õʼֵ(ĬÈÏÖµ),¾ÙÀý: ±ÈÈçÒ»¸öTextBox1,ÎÒÃÇÌîÈëÁË"¹þ¹þ",ÔÚµã»÷SUBMITÌá½»ÁËÒ³Ãæºó,ÔÚPage_Init()ÀïÃæ,ÎÒÃÇ·Ã
Îʵ½µÄTextBox1.Text²»ÊÇÎÒÃǵÄ"¹þ¹þ",¶øÊÇ¿ªÊ¼µÄ""¿Õ×Ö·û´®,Èç¹ûTextBox1ÔÚÎÒÃÇÉè¼ÆµÄʱºòÌṩÁËĬÈÏÖµ£¬ÕâÀï·ÃÎʵ½µÄÒ²¾ÍÊÇÌṩµÄĬ
ÈÏÖµ,ΪʲôÄØ,Õâ¾ÍÒª¿´ÏÂÒ»¸ö¹ý³ÌÁË.
¶ÔÓ¦µÄʼþPage.Init
2. Load ViewState
Õâ¸ö¹ý³ÌÊÇÔØÈëVIEWSTATEºÍPostbackÊý¾Ý£¬±ÈÈçÎÒÃÇÉÏÃæµÄTextBox1,Õâʱ¾Í¸³ÁË"¹þ¹þ",ËùÒÔ,ÔÚPost_Init()¶Ô¿Ø¼þ¸³ÖµÊÇÎÞÒâÒåµÄ,Ëü¶¼»á
ÔÚÕâ¸ö¹ý³ÌÀï±»¸Äд,µ±È»µÚÒ»´ÎÒ³ÃæÔØÈëÀýÍ⣬ÒòΪûÓÐVIEWSTATEÊý¾Ý¡£
ûÓжÔÓ¦µÄʼþ
3.Load Postback data;
ÉÏÃæ˵ÁË,Postback¿ÉÒÔÀí½â³ÉÓû§Ìá½»±íµ¥Êý¾Ý,ËùÒÔÕâÀï¾ÍÊÇ´¦Àí±íµ¥Êý¾Ý,µ±È»ÕâÀïÒªÉè¼Æµ½¿Ø¼þµÄÉè¼Æ,Ò»°ãÇé¿ö²»»áÒªÎÒÃÇ×Ô¼º´¦ÀíÕâ
¸ö¹ý³Ì,ÎÒÃÇÔÝÇÒÂÔ¹ý. (ÔÚÒÔÇ°ÄÇƪ¹ØÓÚASP.NETÒ³ÃæÉúÃüÖÜÆڵļòµ¥ÃèÊöÖÐ,°ÑÕâ¸ö¹ý³ÌºÍLoad ViewState·ÅÔÚÁËÒ»Æð,ÆäʵÄÇÊÇ΢ÈíÌṩµÄÉúÃüÖÜÆÚ¹ý³Ì,ÕâÀïµ¥¶ÀÌá³öÀ´ÊÇΪ
ÁËÈôó¼ÒÃ÷°×ÕâÊÇÒ»¸öµ¥¶ÀµÄ¹ý³Ì)
 
ûÓжÔÓ¦µÄʼþ
4. Page_Load();
Õâ¸ö¹ý³ÌÒ²ÊÇÿ´ÎÒ³ÃæÔØÈëʱһ¶¨»áÖ´Ðеģ¬µ«ÊÇ×¢ÒâºÍPage_InitµÄÇø±ð£¬ÉÏÃæÒѾ­Éæ¼°ÁË,ÕâÀï×¢ÒâµÄÊÇÒ»°ã¶¼»áÓõ½Page.IsPostBack,¸Ã
ֵָʾ¸ÃÒ³ÊÇ·ñÕýΪÏìÓ¦¿Í»§¶Ë»Ø·¢¶ø¼ÓÔØ£¬»òÕßËüÊÇ·ñÕý±»Ê״μÓÔغͷÃÎÊ¡£
private void
Page_Load(object
sender
, System.EventArgs e)
{
  if
(!Page.IsPostBack)
  {
   

//µÚÒ»´ÎÖ´ÐеÄCODE HERE
  }
  else
  {
    //Óû§Ìá½»FORM(¼´Postbac


Ïà¹ØÎĵµ£º

ASP.NET´óÊý¾ÝÁ¿²éѯ·ÖÒ³Àý×Ó

 
ǰ̨ Èç¹ûÄãÓõÄÊÇ gridview ¾Í°ÑRepeaterÌæ»»³Égridview ¡£Ò»ÑùµÄ¡£¡£
 <form id="frm01" action="" method="post" runat="server">
          <asp:ScriptManager ID="ScriptManager1" runat="server">
      & ......

ASP.NET¾­µäÃæÊÔÌâ

1. ¼òÊö private¡¢ protected¡¢ public¡¢ internal ÐÞÊηûµÄ·ÃÎÊȨÏÞ¡£
´ð . private : ˽ÓгÉÔ±, ÔÚÀàµÄÄÚ²¿²Å¿ÉÒÔ·ÃÎÊ¡£
protected : ±£»¤³ÉÔ±£¬¸ÃÀàÄÚ²¿ºÍ¼Ì³ÐÀàÖпÉÒÔ·ÃÎÊ¡£
public : ¹«¹²³ÉÔ±£¬ÍêÈ«¹«¿ª£¬Ã»ÓзÃÎÊÏÞÖÆ¡£
internal: ÔÚͬһÃüÃû¿Õ¼äÄÚ¿ÉÒÔ·ÃÎÊ¡£
£¨partial ÔÊÐí½«Àà¡¢½á¹¹»ò½Ó¿ÚµÄ¶¨Òå²ð·Öµ½¶à¸ ......

Íƽé30±¾ASP.NETÊé

asp.net2.0ѧϰÀú³Ì ²ËÄñµ½Öм¶³ÌÐòÔ±µÄ·ÉÔ¾
2007-06-27 11:08:02 ±¾ÎÄÒѹ«²¼µ½²©¿ÍƵµÀÖ°³¡·´´Òµ·ÖÀà
Èç¹ûÄãÊÇÒ»¸ö²ËÄñ»òÕß×ÔÈÏΪ³õѧÕßÄÇô±¾Îķdz£ÊʺÏÄ㣻
²»ÄÜ˵Õâ30±¾Êé¾ÍÊÇ×î¼Ñ×éºÏ£¬µ«ÊÇ¿ÉÒÔ˵Õâ¸ö×éºÏ²»²î£»
±¾ÈËÔø²©ÀÀȺÊ飬ºÜ¶àÊéÖظ´£¬ºÜ¶àÊé½²µÄ²»ÊÊÓã¬ÕâЩÊ鶼ÊÇÄ¿Ç°Êéµê¿ÉÒÔÂòµ½µÄ£»
´ïµ½Öм ......

ASP.NETÇå³ýÒ³Ã滺´æµÄ·½·¨

ASP.NETÇå³ýÒ³Ã滺´æ
     (1)   Response.Buffer = true;
             Response.ExpiresAbsolute = System.DateTime.Now.AddSeconds(-1);
             Res ......

ASP.NET MVC Uploading and Downloading Files


If you come to ASP.NET MVC from a purely ASP.NET Web Forms background, one of the first things you are likely to notice is that all those nice easy Server Controls have disappeared. One of those is the FileUpload, and its absence seems to cause a few problems. This article looks at how to upload f ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ