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

¿ª·¢asp.net×Ô¶¨Òå¿Ø¼þ

 Ñ§Ï°×Ô¶¨Òå¿Ø¼þµÄ¿ª·¢²»½ö¿ÉÒÔʹÄ㿪·¢³ö¸üÁé»îµÄϵͳ¸üÖØÒªµÄÊÇËü¿ÉÒÔʹÄã¼ÓÉî¶ÔÒÑÓзþÎñÆ÷¿Ø¼þµÄÀí½â£¬µÃÒÔ¸üÁé»îµÄÓ¦Óá£
½ÏÖ®ÓÚasp£¬asp.netÌṩÁ˸üÇ¿´óµÄ¹¦ÄÜ£¬ÎұȽÏϲ»¶ËüµÄ´úÂë·ÖÀë¼¼ÊõºÍ¶ÔÖîÈçC#¡¢VB.NetµÈÇ¿ÀàÐÍÓïÑÔµÄʹÓã¬ÕâÊÇ´Ó¿ª·¢ÕߵĽǶÈÀ´¿´µÄ£¬´ÓÓû§µÄ½Ç¶ÈÀ´¿´£¬»á¾õµÃËüËٶȸü¿ì£¬ÔËÐиüÎȶ¨£¬°²È«ÐÔÒ²¸ü¸ß¡£²»¹ÜÔõô˵£¬Ð¼¼ÊõµÄ²úÉú×Ü»áʹÐí¶àÈ˸е½¸ßÐË£¬²»¹ý¶Ô¿ª·¢ÕßÀ´Ëµ£¬»µÏûÏ¢ÊÇËûÃÇÐèҪѧϰ¸ü¶àеÄ֪ʶ¡£
Asp.netÓÐÁ˺ܶàµÄ¸Ä±ä£¬±ÈÈçÄã¿ÉÄܻᷢÏÖ¹©ÎÒÃDzÙ×÷µÄÔªËØÒ²ºÍÒÔÇ°ÓÐÁ˺ܴóµÄ²»Í¬£¬Ô­À´±ê×¼µÄHTMLÔªËرä³ÉÁËÏÖÔڵķþÎñÆ÷¿Ø¼þ£¬Ëùν·þÎñÆ÷¿Ø¼þ£¬¾ÍÊÇÔÚ·þÎñÆ÷ÉÏÔËÐУ¬²¢¿ÉÒÔÓ³Éäµ½ËùÓÐä¯ÀÀÆ÷Ö§³ÖµÄ±ê×¼ HTML ±ê¼ÇµÄ¿Ø¼þ£¬ÔÚÄãµÄweb´°ÌåÖУ¬·²ÊÇ°üº¬ runat="server" ÊôÐÔÉùÃ÷µÄÔªËض¼½Ð×ö·þÎñÆ÷¿Ø¼þ£¨ÔÚVS.NetÖеÄÉè¼ÆÒ³ÃæÖУ¬ÓÃÒ»¸öССµÄÂÌÉ«¼ýÍ·±íʾ£©£¬Äã¿ÉÒÔÓÃÔ­ÓеÄHTMLÔªËز¢¼ÓÉÏrunat=”server”ÊôÐÔʹÆä±äΪһ¸ö·þÎñÆ÷¿Ø¼þ£¬Õâ½Ð×öHtmlControls£¬Ëü¿ÉÒÔÖ±½ÓÓ³Éäµ½±ê×¼HTML±ê¼Ç£»Ò²¿ÉÒÔʹÓÃ.NetÌṩµÄȫеÄWebControls£¬Ëü±ÈÇ°Õ߸ü³éÏ󣬹¦ÄÜÒ²¸ü¼ÓÇ¿´ó¡£²»¹Ü²ÉÓÃÄÄÒ»Àà¿Ø¼þ£¬runat=”server”ÊôÐÔ¶¼½«»áʹÄã¿ÉÒÔÒÔ±à³Ì·½Ê½·ÃÎÊÕâЩԪËØ¡£
ÕâºÜÈÝÒ×Àí½â£¬·þÎñÆ÷¿Ø¼þ¾ÍÊÇÔÚ·þÎñÆ÷¶ËÔËÐеĿؼþ£¬¾­¹ý·þÎñÆ÷¶ËijЩ³ÌÐòµÄ½âÎöÔÙÉú³É±ê×¼µÄHTML´úÂëÏÔʾÔÚÎÒÃǵÄä¯ÀÀÆ÷ÉÏ£¬ÊÂʵÉÏ£¬Web FormÖ®ËùÒÔ¿ÉÒÔÌṩ×î´ó¿ÉÄܵÄä¯ÀÀÆ÷¼æÈÝÐÔÒ²ÊÇ»ùÓÚ´ËÀí¡£Óëͨ³£µÄÀí½âÉÔÉÔÓÐЩ²»Í¬£¬ÔÚasp.netÖÐ,Ò»¸öÒ³Ãæ(Page)£¬Ò»¸öÑéÖ¤¿Ø¼þ£¬Ò»¸öÓû§¿Ø¼þ(User Control)£¬¶¼¿ÉÒÔ¿´×÷ÊÇÒ»¸ö¶ÀÁ¢µÄ¿Ø¼þ£¬ËüÀ´×ÔÓÚÆäËü¿Ø¼þµÄ×éºÏ¡£³ýÁËʹÓÃ.NetÌṩµÄһϵÁпؼþÍ⣬Ä㻹¿ÉÒÔµ½ÍøÉÏÕÒһЩÃâ·ÑµÄ¿Ø¼þ£¬[url]www.asp.net[/url]ÖеÄControl GalleryÒ»À¸¾ÍÊÕ¼¯Á˺ܶೣÓõÄControl¡£
ÔÚasp.netÖУ¬(´«Í³ÒâÒåÉÏ)¿É¹©Ä㿪·¢µÄ¿Ø¼þʵ¼ÊÉÏÓÐÁ½ÖÖ£ºCustom Control ºÍ User Control¡£Custom Control ÊÇ×ÝÏòµÄ£¬ÊǶÔϵͳ±¾Éí¿Ø¼þµÄ¼Ì³ÐºÍÀ©³ä£¬ÔÚ³ÌÐòÖÐÒÔDLLÎļþÐÎʽ´æÔÚ£¬User Control ÔòÊǺáÏòµÄ£¬ÊǶÔϵͳ±¾Éí¿Ø¼þµÄ×éºÏ£¬ÔÚϵͳÖÐÒÔ.ascxΪºó׺Ãû¡£ÕâÁ½Öֿؼþ¹¦ÄÜÏàͬ£¬¶¼¿ÉÒÔΪ¿ª·¢ÈËÔ±Ìṩ¿É¸´ÓõĿÉÊÓ»¯UI×é¼þ£¬Ïà±ÈÖ®ÏÂÇ°Õß¾ßÓиü´óµÄÁé»îÐÔ£¬Í¬Ê±¿ª·¢ÆðÀ´±È½Ï¸´ÔÓ£¬¶øºóÕßÈÝÒ׿ª·¢£¬µ«¿ÉÖØÓÃÐԾͱȽϲһ°ãÀ´ËµÓû§»áÏÈÓÃUser ControlÀ´¿ª·¢£¬Ö»Óе±Æä²»¿°ÖØÓõÄʱºò²Åת¶øʹÓÃCustom Control¡£
ÊÂʵÉÏ£¬ÓÃ


Ïà¹ØÎĵµ£º

ASP.NETÒ³Ãæ¶ÔÏó

   »ñÈ¡ÇëÇóµÄÒ³µÄ HttpRequest ¶ÔÏó¡£
Ò»¡¢HttpRequest Àà
ʹ ASP.NET Äܹ»¶ÁÈ¡¿Í»§¶ËÔÚ Web ÇëÇóÆڼ䷢Ë굀 HTTP Öµ¡£
      ÏÂÃæµÄ´úÂëʾÀýʹÓà StreamWriter ÀཫÈô¸É HttpRequest ÀàÊôÐÔÖµµÄֵдÈëÎļþ¡£¶ÔÓÚÊÇ×Ö·û´®ÀàÐ͵ÄÊôÐÔ£¬ÊôÐÔÖµ±»Ð´ÈëÎļþʱ½«±»±àÂëΪ HTML¡£±íʾ¼¯ºÏµ ......

ASP.NETÒ³Ãæ¶ÔÏó

 Ò»¡¢Page Àà
      Page ÀàÓëÀ©Õ¹ÃûΪ .aspx µÄÎļþÏà¹ØÁª£»ÕâЩÎļþÔÚÔËÐÐʱ±»±àÒëΪ Page ¶ÔÏ󣬲¢±»»º´æÔÚ·þÎñÆ÷ÄÚ´æÖС£Èç¹ûÊÇʹÓôúÂëÒþ²Ø¼¼Êõ´´½¨ Web ´°ÌåÒ³£¬Çë´Ó¸ÃÀàÅÉÉú¡£
Àý£º£¨public partial class _Default : System.Web.UI.Page£©
      Page ¶ ......

ASP.NETÒ³Ãæ¶ÔÏó – Response

    »ñÈ¡Óë¸Ã Page ¶ÔÏó¹ØÁªµÄ HttpResponse ¶ÔÏ󡣸öÔÏóʹÄúµÃÒÔ½« HTTP ÏìÓ¦Êý¾Ý·¢Ë͵½¿Í»§¶Ë£¬²¢°üº¬ÓйظÃÏìÓ¦µÄÐÅÏ¢¡£
Ò»¡¢HttpResponse Àà
·â×°À´×Ô ASP.NET ²Ù×÷µÄ HTTP ÏìÓ¦ÐÅÏ¢¡£
HttpResponse ÀàÐ͹«¿ªÒÔϳÉÔ±¡£
 ¹¹Ô캯Êý
Ãû³Æ
˵Ã÷
HttpResponse
»ù´¡½á¹¹¡£³õʼ»¯ HttpRespons ......

ASP.NET MVC Best Practices 27+

12 ASP.NET MVC Best Practices
M
DomainModel != ViewModel
Use ActionFilters for “shared” data
V
Do NEVER user code-behind
Write HTML each time you can
If there is an if, write an HtmlHelper
Choose your view engine carefully
C
Delete the AccountController
Isolate Controllers fro ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ