ASP.NET MVC ¼ò½é
Õâ¸öÊÇÔÚÍøÉÏÕÒµÄÒ»¸ö¹ØÓÚASP.NET MVC µÄ¶¨Ò壬ÎÒ¾õµÃÒѾ½âÊ͵Ĺ»ºÃÁË£¬ËùÒԾͽè¹ýÀ´ÓÃÓÃÁË £¬ºÇºÇ
Ï£ÍûÓÐÐÄѧϰASP.NET MVC µÄÅóÓÑÏÈÊìϤ¶¨Ò壬ÔÚºóÐøµÄÎÄÕÂÖлá¸üÇáËɵÄѧϰASP.NET MVC
ÏÂÃæÎÒÃÇÒ»Æð̤ÉÏASP.NET MVC Ö®Âðɣ¬Ö»ÒªÓкãÐĺÍÒãÁ¦£¬×£Ñ§ÕßÃÇÂÃ;Óä¿ì£¡
The Model-View-Controller (MVC) architectural pattern separates an application into three main components: the model, the view, and the controller. The ASP.NET MVC framework provides an alternative to the ASP.NET Web Forms pattern for creating MVC-based Web applications. The ASP.NET MVC framework is a lightweight, highly testable presentation framework that (as with Web Forms-based applications) is integrated with existing ASP.NET features, such as master pages and membership-based authentication. The MVC framework is defined in the System.Web.Mvc namespace and is a fundamental, supported part of the System.Web namespace.
MVC is a standard design pattern that many developers are familiar with. Some types of Web applications will benefit from the MVC framework. Others will continue to use the traditional ASP.NET application pattern that is based on Web Forms and postbacks. Other types of Web applications will combine the two approaches; neither approach excludes the other.
MVC¼Ü¹¹Ä£Ê½½«Ó¦ÓóÌÐò·ÖΪģÐÍ-ÊÓͼ-¿ØÖÆÆ÷Èý¸öÖ÷Òª×éÖ¯²¿·Ö£¬ASP.NET MVC¿ò¼ÜÌṩһÖÖ¿ÉÒÔ´úÌæASP.NET Web FormsģʽÀ´´´½¨»ùÓÚMVCµÄÓ¦ÓóÌÐò£¬ASP.NET MVCÊÇÇáÁ¿¼¶µÄ£¬¸ß¿É²âÊԵĿò¼Ü£¬²¢ÇÒ¿ÉÒÔ½áºÏÏÖÓеÄASP.NETµÄÌØÐÔÈçĸ°å¡¢»ùÓÚmembershipµÄÉí·ÝÑéÖ¤£¬MVC¿ò¼Ü»ù´¡¶¨ÒåÔÚSystem.Web.MvcÃüÃû¿Õ¼äÖеģ¬³ÉΪSystem.WebÃüÃû¿Õ¼äµÄÒ»²¿·Ö¡£
MVC×÷Ϊһ¸ö±ê×¼µÄÉè¼Æģʽ±»¹ã´óµÄ¿ª·¢ÈËÔ±ËùÊìÖª¡£Ä³Ð©ÀàÐ͵ÄWebÓ¦ÓóÌÐò½«ÊÜÒæÓÚMVC framework¡£ÆäËüÀàÐ͵ÄÓ¦ÓóÌÐò¿ÉÒÔ¼ÌÐøʹÓô«Í³µÄ»ùÓÚPostbacksµÄWeb formsģʽ½øÐÐASP.NET¿ª·¢£¬Ò²¿ÉÒÔ½áºÏÕâÁ½ÖÖģʽ£¬ËüÃÇÊDz¢ÐдæÔÚ¶ø²»ÊÇ»¥Ïà³åÍ»µÄ¡£
The MVC framework includes the following components:
MVC¿ò¼Ü°üº¬ÈçÏÂ×é³É²¿·Ö£º
Models. Model objects are the parts of the application that implement the logic for the application's data domain. Often,
Ïà¹ØÎĵµ£º
ÎÒÓÃC# дµÄÒ»¸öWindowsÓ¦ÓóÌÐòÀï,ÓÃTeeChartʵÏÖÁËÒ»¸öÕÛÏßͼ.
XÖáÊÇʱ¼ä,YÖáÊÇÊýÖµ,¼ÓÁ˸öÒ»´¹Ö±µÄCursorTool.
Êó±êÔÚͼÉÏÒƶ¯Ê±,´¹Ö±µÄCursorTool»á¸ú×ÅÊó±êÅÜ,²¢´¥·¢CursorToolµÄChangeʼþ.
ÔÚCursorToolµÄChangeʼþÀï,
ÎÒÈ¡³öÁËÇúÏßÓë´¹Ö±µÄÏß½»µã´¦µÄ,ʱ¼äÖµ,ºÍÊýÖµ.
ÎÒдÕâ¸öWindow³ÌÐòµÄÖ÷ÒªÉϵÄÊÇÃþ ......
×öÍøÕ¾Óë¸ã°²È«Ò»°ã¶¼Àë²»¿ªÈ¨ÏÞ·ÖÅä,ÍøվȨÏÞÒ»°ã¶¼Ö±½ÓÉèÖÃÕ¾µãËùÔÚµÄÐéÄâĿ¼µÄ,Ò²¾ÍÊÇÔÚÐéÄâĿ¼µÄ°²È«ÀïÌí¼ÓinternetÀ´±öÕË»§,²¢·ÖÅä³ýÍêÈ«¿ØÖÆÍâµÄËùÓÐȨÏÞ;Èç¹ûÊÇ.NET,»¹±ØÐë¸øASP.NETÓû§ÅäÖóýÍêÈ«¿ØÖÆÒÔÍâµÄȨÏÞ!
Ò»°ãÇé¿öÏÂ,ÕâÑù¾ÍOKÁË,·þÎñÆ÷ÉϵÄÒ»°ãÍøÕ¾¶¼¿ÉÒÔÕý³£ÔËÐÐÁË!µ«ÏÖÔÚÎÒ·¢ÏÖ:C\WINDOWS ......
ÔÚ¿ª·¢ÐèÒªÓû§×¢²áºó²ÅÄÜʹÓÃÌṩµÄ¸÷ÏÄܵÄÓ¦ÓóÌÐòʱ£¬ÔÚÐÂÓû§Ìá½»×¢²áÐÅÏ¢ºó£¬½Ï³£¼ûµÄ×ö·¨ÊÇÓɳÌÐòÉú³ÉËæ»úÃÜÂ룬Ȼºó·¢ËÍÃÜÂëµ½Óû§×¢²áʱÌîдµÄµç×ÓÐÅÏ䣬Óû§ÔÙÓÃÊÕµ½µÄÃÜÂëÀ´¼¤»îÆäÕÊ»§¡£
ʵÏÖASP.NETÉú³ÉËæ»úÃÜÂ빦ÄÜÊǺÜÈÝÒ׵ģ¬ÏÂÃæµÄ´úÂë¸ø³öÁËÍêÕûµÄʵÏÖ·½·¨£º
publicstaticstringMakePassword(st ......
——Áé»îÔËÓà Form ±íµ¥ÈÏÖ¤ÖÐµÄ deny Óë allow ¼°±£»¤ .htm µÈÎļþ
×÷Õߣºº®Óð·ã(cityhunter172)
µÚ¶þ²¿·Ö Form ÈÏÖ¤µÄʵսÔËÓÃ
»°ËµÉϻأ¬¼òµ¥µØ˵ÁËһϠForm ±íµ¥ÈÏÖ¤µÄÓ÷¨¡£»òÐí´ó¼Ò¾õµÃÌ«¼òµ¥£¬¶ÔÄÇЩ´óÄÚ¸ßÊÖÀ´ËµÓ¦¸ÃÊÇ“È÷È÷Ë®À²”“С Kiss À²£¨Ð¡Òâ˼£©”¡£½ñÌìÔÛÃÇÀ´µã ......
//´´½¨
HttpCookie cookie = new HttpCookie("user","111");//´´½¨Cookie
cookie Expires = DateTime.Now.Add(15);//ÉèÖùýÆÚʱ¼ä
Response.Cookies.Add(cookie);//´æÈë¿Í»§¶Ë
ÎÒÃÇÈ¡³öCookieÖµÒ²ºÜ¼òµ¥
string value = Request.Cookies["user"].value;
ÓÐʱºòÎÒÃÇÏëÔÚÒ»¸öCookieÖд¢´æ¶à¸öÐÅÏ¢£¬ÄÇÒ ......