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

ASP.NET MVC¹Ù·½Ö¸ÄÏѧϰ×ܽá

MVC¿ò¼ÜͼÈçÏ£º
ÔÚÄã¾ö¶¨Ê¹ÓÃMVC¿ò¼Ü»òWeb Formsģʽ¿ª·¢Ö®Ç°£¬ÇëÈÏÕæºâÁ¿Ò»Ï¸÷×ÔµÄÓŵ㡣
»ùÓÚMVCµÄWebÓ¦ÓóÌÐòÓŵ㣺
ËüÄܺÜÈÝÒ׵ĹÜÀí¸´ÔÓµÄÓ¦ÓóÌÐò£¬½«Ëü·ÖΪmodel£¬viewºÍcontroller¡£
Ëü²»ÄÜʹÓÃview stateºÍ·þÎñÆ÷¿Ø¼þ£¬ÕâʹµÃMVC¿ò¼Ü¿ª·¢ÈËÔ±ÓµÓжÔÓ¦ÓóÌÐòÍêÈ«¿ØÖƵÄÄÜÁ¦¡£
ËüʹÓÃÇ°¶Ë¿ØÖÆÆ÷ģʽ£¬Í¨¹ýµ¥Ò»µÄ¹ý³Ì´¦ÀíWebÓ¦ÓóÌÐòµÄÇëÇó£¬ÕâʹÄã¿ÉÒÔʹÓ÷ḻµÄURL routingÀ´Éè¼ÆÓ¦ÓóÌÐò¡£¸ü¶àÐÅÏ¢¿ÉÒÔÔÚMSDNÕ¾µãµÄFront Controller²é¿´¡£
Ëü¶Ô²âÊÔÇý¶¯¿ª·¢£¨TDD£©Ìṩ¸üºÃµÄÖ§³Ö¡£
Ëü¿ÉÒÔÈÃWeb¿ª·¢ÕߺÍÒ³ÃæÉè¼ÆÈËÔ±¿ØÖÆ×Ô¼º¹ØÐĵŤ×÷£¬´ÓÒ³ÊʺϴóÐÍÍŶӵĿª·¢¡£
»ùÓÚWeb Forms WebÓ¦ÓóÌÐòµÄÓŵ㣺
Ëü¿ÉÒÔÖ§³ÖʼþÄ£ÐͲ¢±£´æHTTPµÄ״̬£¬ÒæÓÚÏßÐÔÒµÎñµÄWebÓ¦ÓóÌÐò¿ª·¢£¬»ùÓÚWeb FormsÓ¦ÓóÌÐòÌṩÁËÐíÐí¶à¶àµÄʼþºÍÉÏ°ÙÖֵķþÎñÆ÷¿Ø¼þ¡£
ËüʹÓÃÒ³Ãæ¿Ø¼þÆ÷ģʽ£¬ÔÚµ¥¸öÒ³ÃæÖÐʵÃæºÜ¶àµÄ¹¦ÄÜ¡£¸ü¶àÐÅÏ¢Çë²Î¿¼MSDNÕ¾µãÉϵÄPage Controller¡£
ËüʹÓÃview stateºÍ»ùÓÚ·þÎñÆ÷µÄ±íµ¥£¬Ê¹µÃ¹ÜÀíÒ³Ãæ״̬ÐÅÏ¢¸ü¼ÓÈÝÒס£
ËüÊʺÏСµÄ¿ª·¢ÍŶӣ¬Ê¹Óø߶ȼ¯³ÉµÄ¿Ø¼þÀ´Ìá¸ßWebÉè¼ÆÈËÔ±ºÍÍøÒ³Éè¼ÆÈËÔ±µÄЧÂÊ¡£
Ò»°ãÀ´Ëµ£¬ËüÊʺϲ»ÊÇÄÇô¸´ÔÓµÄÓ¦ÓóÌÐò¿ª·¢£¬ÒòΪËüµÄÒ³ÃæÀàºÍ¿Ø¼þÀàÊǺϲ¢ÔÚÒ»ÆðµÄ£¬ËùÒÔÏà¶ÔÓÚMVCģʽÀ´ËµËüÐèÒª±àдµÄ´úÂë¸üÉÙ¡£
 
Asp.net MVCÖ§³ÖASP.NET¿ò¼ÜµÄÌØÐÔ£º
formsµÄÉí·ÝÑéÖ¤ºÍWindowsµÄÉí·ÝÑéÖ¤¡£
URLÑéÖ¤¡£
MembershipºÍroles¡£
Êä³öºÍÊý¾Ý»º´æ¡£
sessionºÍprofile״̬¹ÜÀí¡£
½¡¿µ×´Ì¬¼à¿Ø¡£
configurationϵͳºÍprovider¼Ü¹¹¡£
 
ÒÔϱí¸ñÊÇASP.NET MVCÖ´ÐÐÖÜÆÚÖÐËù´¦µÄ½×¶Î£º
½×¶Î
½éÉÜ
ÊÕµ½µÚÒ»´ÎÇëÇó
ÔÚGlobal.asaxÎļþÖн«Route¶ÔÏóÒÀ´ÎÔö¼Óµ½RouteTable¶ÔÏó¡£
Ö´ÐзÓÉ
UrlRoutingModuleÄ£¿éÏÈ´ÓRouteTable¼¯ºÏÖÐÒÀ´ÎÆ¥ÅäRoute£¬Èç¹ûÆ¥Åäµ½ºó¾Í´´½¨RouteData¶ÔÏó£¬È»ºóʹÓÃËüÀ´´´½¨RequestContext£¨IHttpContext£©¶ÔÏó¡£
´´½¨ÇëÇóMVC´¦ÀíÄ£¿é
MvcRouteHandler¶ÔÏó´´½¨Ò»¸öMvcHandlerµÄʵÀýÀàÐͲ¢´«ÈëRequestContextµÄʵÀý
´´½¨controller
MvcHandler¶ÔÏóʹÓÃRequestContextʵÀýÒÔÈ·¶¨IControllerFactory¶ÔÏó£¨Í¨³£ÊÇDefaultControllerFactoryÀàµÄʵÀý£©À´´´½¨controllerʵÀý¡£
Ö´ÐÐcontroller
The MvcHandler instance calls the controller's Execute method.
MvcHandlerʵÀýµ÷ÓÃcontrollerµÄExecute·½·¨¡£
µ÷ÓÃaction
´ó¶àÊý¿ØÖÆÆ÷¼Ì³Ð×ÔController»ùÀ࣬Contro


Ïà¹ØÎĵµ£º

ASP.NET¹ØÓÚÌõÐÎÂëµÄÉú³ÉÎÊÌâ¼æÍøÒ³´òÓ¡

ÌõÐÎÂëÊÇÆù½ñΪֹ×î¾­¼Ã¡¢ÊµÓõÄÒ»ÖÖ×Ô¶¯Ê¶±ð¼¼Êõ¡£ÌõÐÎÂë¼¼Êõ¾ßÓÐÒÔϼ¸¸ö·½ÃæµÄÓŵã
¡¡¡¡A£®ÊäÈëËٶȿ죺Óë¼üÅÌÊäÈëÏà±È£¬ÌõÐÎÂëÊäÈëµÄËÙ¶ÈÊǼüÅÌÊäÈëµÄ5±¶£¬²¢ÇÒÄÜʵÏÖ“¼´Ê±Êý¾ÝÊäÈ딡£
¡¡¡¡B£®¿É¿¿ÐԸߣº¼üÅÌÊäÈëÊý¾Ý³ö´íÂÊΪÈý°Ù·ÖÖ®Ò»£¬ÀûÓùâѧ×Ö·ûʶ±ð¼¼Êõ³ö´íÂÊΪÍò·ÖÖ®Ò»£¬¶ø²ÉÓÃÌõÐÎÂë¼¼ÊõÎóÂëÂʵ ......

asp.net ʵÏÖ¶¨Ê±Ö´ÐÐ Ò»¸ö·½·¨

 asp.net ʵÏÖ¶¨Ê±Ö´ÐÐ Ò»¸ö·½·¨
public class Time_Task
{
    public event System.Timers.ElapsedEventHandler ExecuteTask;
    private static readonly Time_Task _task = null;
    private System.Timers.Timer _timer = null;
    privat ......

asp.netÃæÊÔÌâ(4)

41.¹¹ÔìÆ÷constructorÊÇ·ñ¿É±»override?   
 
´ð£º¹¹ÔìÆ÷constructor²»Äܱ»¼Ì³Ð£¬Òò´Ë²»ÄÜÖØдoverriding£¬µ«¿ÉÒÔ±»ÖØÔØoverloading¡£   
 
 
 
42.ÊÇ·ñ¿ÉÒԼ̳ÐstringÀà?   
 
´ð£ºstringÀàÊÇfinalÀà¹Ê²»¿ÉÒԼ̳С£  &n ......

asp.netÃæÊÔÌâ(6)

81.ʲôÊÇsoap,ÓÐÄÄЩӦÓᣠ  
 
´ð£ºsimple object access protocal,¼òµ¥¶ÔÏó½ÓÊÜЭÒé.ÒÔxmlΪ»ù±¾±àÂë½á¹¹,½¨Á¢ÔÚÒÑÓÐͨÐÅЭÒéÉÏ(Èçhttp,²»¹ý¾Ý˵msÔÚ¸ã×îµ×²ãµÄ¼Ü¹¹ÔÚtcp/ipÉϵÄsoap)µÄÒ»Öֹ淶web serviceʹÓõÄЭÒé..   
 
 
 
82.c#ÖÐ property Óë a ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ