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

ASP.NET MVC ¿ò¼Ü

¹ýÈ¥µÄ¼¸ÄêÀºÜ¶àÈËÒªÇóASP.NETµÄÒ»¼þÊÂÇé¾ÍÊǶÔʹÓûùÓÚmodel-view-controller£¨Ä£ÐÍ-ÊÓͼ-¿ØÖÆÆ÷,¼ò³ÆMVC£©¼Ü¹¹À´¿ª·¢webÓ¦ÓõÄÄÚÖÃÖ§³Ö¡£
ÉϸöÖÜÄ©ÔÚAustin¾ÙÐеÄAlt.NET´ó»áÉÏ£¬ÎÒÊ״ζÔÎÒµÄÍŶÓÕýÔÚ¿ª·¢µÄÐÂASP.NET MVC ¿ò¼Ü×÷ÁËÒ»¸ö¹«¿ªµÄÑÝʾ¡£Äã¿ÉÒÔÔÚScott HanselmanÕâÀïµÄ²©¿Í
ÉϹۿ´ÎҵĽ²×ùµÄ¼Ïñ¡£
ÎÒÃǽ«ÔÚ½ñÄêÉÔºó·¢²¼¸Ã¿ò¼ÜµÄÒ»¸ö¹«¿ªÔ¤ÀÀ°æ£¬È»ºóÔÚÃ÷ÄêµÄÉÏ°ëÄ꽫Ëü×÷ΪÍêÈ«Ö§³ÖµÄASP.NETÌØÐÔÍƳö¡£
Ä£ÐÍ-ÊÓͼ-¿ØÖÆÆ÷(MVC)¿ò¼ÜÊÇʲô¶«Î÷£¿
MVCÊǸö½«Ò»¸öÓ¦ÓõÄʵÏÖ·Ö³ÉÈý¸ö×é¼þ½ÇÉ«µÄ¿ò¼Ü¼¼Êõ£ºÄ£ÐÍ£¬ÊÓͼºÍ¿ØÖÆÆ÷¡£
ÔÚ»ùÓÚMVCµÄÓ¦ÓÃÀModel(Ä£ÐÍ)ÊǸºÔð±£³Ö״̬µÄÓ¦ÓÃ×é¼þ¡£Õâ¸ö״̬ͨ³£¶¼³Ö¾ÃÓÚÊý¾Ý¿âÖ®ÖУ¨Æ©È磬ÎÒÃÇÒ²Ðí»áÓÐÒ»¸öProduct£¨²úÆ·£©ÀàÓÃÀ´´ú±íSQLÖеÄProductsÊý¾Ý±íÖеĶ©µ¥Êý¾Ý)¡£
ÔÚ»ùÓÚMVCµÄÓ¦ÓÃÀView(ÊÓͼ)ÊǸºÔðÏÔʾÓû§½çÃæµÄ×é¼þ¡£Õâ¸öUIͨ³£ÊÇʹÓÃÄ£ÐÍÊý¾ÝÀ´´´½¨µÄ£¨Æ©È磬ÎÒÃÇÒ²Ðí»áÉú³ÉÒ»¸öProduct"±à¼­"ÊÓͼ£¬¸ù¾Ýµ±Ç°Product¶ÔÏóµÄ״̬£¬ÏÔʾÎı¾¿ò£¬ÏÂÀ­¿òºÍ¸´Ñ¡¿òµÈ)¡£
ÔÚ»ùÓÚMVCµÄÓ¦ÓÃÀController(¿ØÖÆÆ÷)ÊÇ´¦ÀíÓû§½»»¥£¬²Ù×÷Ä£ÐͺÍ×îÖÕÑ¡ÔñÓÃÄĸöÊÓͼÀ´ÏÔʾUIµÄ×é¼þ¡£ÔÚMVCÓ¦ÓÃÖУ¬ÊÓͼֻÊÇÓÃÀ´ÏÔʾÐÅÏ¢¶øÒÑ£¬ÊÇ¿ØÖÆÆ÷À´´¦ÀíºÍ»ØÓ¦Óû§µÄÊäÈëºÍ½»»¥µÄ¡£
ʹÓÃMVC·½·¨µÄÒ»¸öºÃ´¦ÊÇ£¬ËüÓÐÖúÓÚ´Ù½øÓ¦ÓÃÖÐÄ£ÐÍ£¬ÊÓͼ£¬¿ØÖÆÆ÷¼äµÄ¹Ø×¢µÄÇåÎú·ÖÀë¡£±£³Ö¹Ø×¢µÄÇåÎú·ÖÀëʹµÃ¶ÔÓ¦ÓõIJâÊÔ¼«ÆäÈÝÒ×£¬ÒòΪ²»Í¬Ó¦ÓÃ×é¼þ¼äµÄÆõÔ¼µÄ¶¨ÒåºÍ±í´ïÊǸüÃ÷È·µÄ¡£
MVCģʽҲÓÐÀûÓÚ´Ù½øºì/ÂÌʽ²âÊÔÇý¶¯µÄ¿ª·¢
£¨TDD)£¬Í¨¹ýËü£¬Äã¿ÉÒÔÔÚÄãʵ¼Ê±àдӦÓôúÂë±¾Éí֮ǰÊ×ÏÈʵÏÖ×Ô¶¯»¯µÄµ¥Ôª²âÊÔ£¬ÕâЩµ¥Ôª²âÊÔ¶¨ÒåºÍºËʵÁËдúÂëµÄÐèÇó¡£
ASP.NET MVC ¿ò¼ÜµÄһЩ¼òҪϸ½Ú
ÔÚ¼¸¸öÐÇÆÚºó£¬Ïà¹Ø´úÂë¿ÉÒÔÏÂÔØÖ®ºó£¬ÎÒ½«Ð´Ò»Ð©¹ØÓÚÕâ¸öеÄASP.NET MVC ¿ò¼ÜµÄÉîÈëÐԵĽ̳ÌÌù×Ó£¨Óë´Ëͬʱ£¬Ïë½øÒ»²½Á˽âËüµÄ×î¼Ñ·½Ê½Êǹۿ´ÎÒµÄAlt.net½²×ùµÄ¼Ïñ
£©£º
ÕâÀïÊǹØÓÚASP.NET MVC ¿ò¼ÜµÄһЩ¼òҪϸ½Ú£º
Ëü½«´Ù½øÇåÎúµÄ¹Ø×¢·ÖÀ룬¿É²âÊÔÐÔ£¬ºÍTDD¡£MVC¿ò¼ÜÖеÄËùÒÔºËÐÄÆõÔ¼¶¼ÊÇ»ùÓڽӿڵģ¬¿ÉÒÔÇáÒ×µØͨ¹ýmockÀ´Ä£Äâ
£¨°üÀ¨»ùÓÚ½Ó¿ÚµÄ
IHttpRequest/IHttpResponseÕâЩ»ù±¾µÄ¶«Î÷£©¡£Äã¿ÉÒÔ²»ÓÃÔÚASP.NET½ø³ÌÖÐÔËÐпØÖÆÆ÷£¨ÕâʹµÃµ¥Ôª²âÊԺܿ죩£¬¾Íµ¥Ôª²â
ÊÔÄãµÄÓ¦Óá£Äã¿ÉÒÔʹÓÃÄãÏëʹÓõÄÈκε¥Ôª²âÊÔ¿ò¼ÜÀ´×öµ¥Ôª²âÊÔ£¬°üÀ¨NUnit, MBUnit, MS TestµÈµÈ¡£
Õâ¸ö¿ò¼Ü¾ßÓи߶ȵĿÉÀ©Õ¹Ð


Ïà¹ØÎĵµ£º

ASP.netµÄURLÖØд ÂäÈÕ¿Õ¼ä

ASP.net
µÄ
URL
ÖØд
 
ÓйØÓÚ
URL
µÄÖØд£¬±¾ÎÄÒ²Ö»ÊÇÄÃÀ´Ö÷Òâ¡£Ïà¼ÌÓÐ
MS
µÄ×é¼þ“
URLRewriter”ºÍÔÚGlobal.asaxÀïµÄ“
Application_BeginRequest()”±àÂ뷽ʽ£¬ÒÔ¼°IISÀïµÄISAPIÉèÖá£
ÄÈÁÐÏÂÀ´£¬ÊµÏÖ·½·¨Ò²¶¼ºÜ¼òµ¥¡£
 
·½·¨Ò»£ºMS×é¼þ
ÕâÀïÒ²²»ÓÃÏê½âÁË£¬Ïà¹ØÇë¿´£º
......

Asp.NetÖдøͼƬµÄÖØÌî°´Å¥


°ÑÎÒ×öµÚÒ»´Î×öϵͳʱ¶ÔÖØÌî°´Å¥µÄʵÏּǼÈçÏ£º
  µÚÒ»´ÎÓÃImageButton¿ÉÒÔÉèÖñ³¾°Í¼Æ¬£¬È»ºóÔÚºǫ́µÄClickʼþÖÐдÈçÏÂ
 this.TxtCallNo.Text = "";
this.TxtCaller.Text = "";
this.TxtTranDate.Text = "";
this.TxtTranLimit.Text = "";
this.TxtTra ......

ASP.NETÎļþÉÏ´«ÏÂÔØ

ÏÂÔØÎļþ£ºstring musicUrl = "music/" + Request.QueryString["murl"].ToString();
string fileName = Request.QueryString["murl"].ToString();
string filePath = Server.MapPath(musicUrl);//·¾¶
FileInfo fileInfo = new FileInfo(filePath);
Response.Clear();
Response.Cl ......

asp.netÖ§³Ö´óÎļþÉÏ´« NeatUpload

1.ÔÚ¹¤¾ßÏäÖÐÌí¼ÓBrettle.Web.NeatUpload.dll£¬¿ÉÒÔ¿´µ½¹¤¾ßÏäÖгöÏÖInputFileµÈ¿Ø¼þ¡£
2.¸´ÖÆÎļþ¼ÐNeatUploadµ½¸ùĿ¼.
3.ÍÏ·ÅʹÓÃÉÏ´«¿Ø¼þInputFileºÍ½ø¶ÈÌõProgressBar,Ìí¼ÓÉÏ´«ÎļþµÄ°´Å¥.aspxÒ³Ãæ´úÂëÈçÏ£º
<body>
<form id="form1" runat="server">
<div>
<upload: ......

c#(asp.net) updatepanel ¾Ö²¿Ë¢ÐÂʵÀýÊÕ²Ø

1
<asp:UpdatePanelID="UpdatePanel1"
        UpdateMode="Conditional"
        runat="server">
    <ContentTemplate>
        <asp:Button ID="Button1"
      ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ