ÐÂÊÖ¸ú×ÅѧAsp.net MVC2 Controller
ÉÏ´ÎÎÒÃÇ˵µ½ÁË route ·ÓɵŦÄÜ,Õû¸ömvcÔËÐйý³Ì:
Route(·ÓÉ) --> Controller(¿ØÖÆÆ÷)-->action(·½·¨)
Õâ´ÎÎÒÃÇҪ˵µÄ¾ÍÊÇ controller ¿ØÖÆÆ÷ ºÍ action£º
¿ØÖÆÆ÷µÄ×÷ÓþÍÊÇ£ºµ±Ò»¸ö Request À´µÄʱºò£¬Ê×ÏÈRoute ½âÎö ÕÒµ½ÁË ¶ÔÓ¦ ¿ØÖÆÆ÷£¬¿ØÖÆÆ÷ÔÙ¸ù¾Ý action ¾ö¶¨¸øÎÒÃÇ·µ»ØʲôÑùµÄÄÚÈÝ¡£È磺
´úÂë
public class MyControllerController : Controller
{
public ActionResult MyAction(DateTime dt)
{
ContentResult cr = new ContentResult();
cr.Content = "MyController's MyAction is Workded!" + dt.ToString("yyyyÄêMMÔÂddÈÕ");
return cr;
}
public void MyTest()
{
Response.Write("hhhh");
}
}
Ê×ÏÈ£º ¿ØÖÆÆ÷Àà ±ØÐë¼Ì³Ð Controller£¬Õâ¸öÎÒÃÇн¨controller µÄʱºò ¶¼ÒѾ¸øÎÒÃǼ̳кÃÁË£¬ÕâÀïÎÒÃÇÆðÁËÒ»¸öÃû×ֽГMyController”£»
ÕâÀï¿ØÖÆÆ÷ÃüÃû¹æÔò ×îºóÐèÒªÊÇController£¬È磺TestController……
Õâ¸ö¿ØÖÆÆ÷ÀïÃæÎÒÃÇдÁË2¸ö·½·¨£¬Ê×ÏȵÚÒ»¸ö MyAction£¬½ÓÊյIJÎÊýÊÇ DateTimeÐ굀 dt£¬ÕâÀïÎÒÃǵÚÒ»¸ö±Ê¼ÇÒѾ˵µ½ÁËurl ¹æÔòÀïÃæµÄ {dt}²ÎÊý£¬ÕâÀïÎÒÃÇÕâÑù½ÓÊÕµ½ÎÒÃÇurlÀïÃæËù´«µÝµÄ²ÎÊý;·µ»ØÀàÐÍÊÇ ActionResult£¬·µ»ØÀàÐÍÓкü¸ÖÖÈ磺
ViewResult:Ò»°ã³ÊÏÖij¸öaspxÎļþ£¬ÓÉView·½·¨·µ»Ø¡£
RedirectToResult:ʹä¯ÀÀÆ÷Öض¨Ïò£¬ÓÉRedirect·½·¨·µ»Ø¡£
RedirectToRouteResult:Ö±½Ó½»¸øÏÂÒ»¸öAction£¬ÓÉRedirectToAction·½·¨·µ»Ø¡£
ContentResult:ÒÔÎÄ×ÖÐÎʽ·µ»Ø
ÉÏÃæÊdz£Óõļ¸Ö
Ïà¹ØÎĵµ£º
ѧϰASP.NETÖеÄApplication¡¢Session¡¢Cookie
1.Application½¨Á¢µÄ±äÁ¿£¬ÔÚϵͳÄÚ²¿Èκεط½¶¼¿ÉÒÔ·ÃÎÊ£¬Í¨³£ÍøÕ¾µØ·ÃÎÊͳ¼Æ¿ÉÄÜ»áÓõĽ϶ࡣÈç¹ûÒªÓõ½ApplicationÊ×ÏÈÔÚVS2005Öн¨Á¢Ò»¸öglobal.asaÎļþ¡£ÀýÈçÎÒÃÇҪдһ¸öÍøÕ¾·ÃÎÊÊýÁ¿µÄͳ¼ÆµÄ»°£¬ÔÚglobal.asaÖÐÏÈÉùÃ÷±äÁ¿iCount¡£ÈçÏÂËùʾ£º
  ......
ÀýÒ»£º
+++ ÐÞ¸ÄGlobal.asaxÎļþ£º
<%@ Application Language="C#" %>
<script runat="server">
void Application_Start(object sender, EventArgs e)
{ }
void Application_End(object sender, EventArgs e)
{ }
void Application_Error(object sender, EventArgs e)
{ }
void ......
+++ ÐÞ¸ÄWebConfigÎļþ£º
<?xml version="1.0"?>
<configuration>
<appSettings>
<add key="connStr" value="Data Source=ora11g;uid=scott;pwd=tiger;unicode=true"/>
</appSettings>
<connectionStrings>
<ad ......
²Î¿¼ http://topic.csdn.net/t/20040510/19/3051316.html
¿ªÊ¼
ÔËÐÐ
dcomcnfg
×é¼þ·þÎñÒ»ÏîÖÐÑ¡ÔñDcomÅäÖã¬ÕÒµ½Microsoft excelÓ¦ÓóÌÐò£¬²ì¿´ÊôÐÔ
°²È«Ñ¡ÏÖУ¬Æô¶¯È¨Ï޺ͷÃÎÊȨ ......
µÚÒ»²½¡¡ÕÆÎÕÒ»ÃÅ.NETÃæÏò¶ÔÏóÓïÑÔ£¬C#»òVB.NET ÎÒÇ¿ÁÒ·´¶ÔÔÚûϵͳѧ¹ýÒ»ÃÅÃæÏò¶ÔÏó(OO)ÓïÑÔµÄÇ°ÌáÏÂȥѧASP.NET¡£ ASP.NETÊÇÒ»¸öÈ«ÃæÏò¶ÔÏóµÄ¼¼Êõ£¬²»¶®OO£¬ÄǾø¶Ôѧ²»ÏÂÈ¥!
¡¡¡¡µÚ¶þ²½¡¡¶Ô.NET FrameworkÀà¿âÓÐÒ»¶¨µÄÁ˽⠿ÉÒÔͨ¹ý¿ª·¢Windows FormÓ¦ÓóÌÐòÀ´Ñ§Ï°.NET Framework¡£ASP.NETÊǽ¨¹¹ÔÚ.NET FrameworkÖ®É쵀 ......