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

ÐÂÊÖ¸ú×Åѧ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

ѧϰASP.NETÖеÄApplication¡¢Session¡¢Cookie
1.Application½¨Á¢µÄ±äÁ¿£¬ÔÚϵͳÄÚ²¿Èκεط½¶¼¿ÉÒÔ·ÃÎÊ£¬Í¨³£ÍøÕ¾µØ·ÃÎÊͳ¼Æ¿ÉÄÜ»áÓõĽ϶ࡣÈç¹ûÒªÓõ½ApplicationÊ×ÏÈÔÚVS2005Öн¨Á¢Ò»¸öglobal.asaÎļþ¡£ÀýÈçÎÒÃÇҪдһ¸öÍøÕ¾·ÃÎÊÊýÁ¿µÄͳ¼ÆµÄ»°£¬ÔÚglobal.asaÖÐÏÈÉùÃ÷±äÁ¿iCount¡£ÈçÏÂËùʾ£º
     ......

ASP.NETÒ³Ãæ´«Öµ_µÚËÄƪ_Session

ÀýÒ»£º
+++ ÐÞ¸Ä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 ......

ASP.NETÒ³Ãæ´«Öµ_µÚ°Ëƪ_WebConfig

+++ ÐÞ¸ÄWebConfigÎļþ£º
<?xml version="1.0"?>
<configuration>
  <appSettings>
    <add key="connStr" value="Data Source=ora11g;uid=scott;pwd=tiger;unicode=true"/>
  </appSettings>
  <connectionStrings>
    <ad ......

asp.net ´òÓ¡ ¾Ü¾ø·ÃÎÊ

²Î¿¼ http://topic.csdn.net/t/20040510/19/3051316.html
      ¿ªÊ¼
      ÔËÐÐ
      dcomcnfg
      ×é¼þ·þÎñÒ»ÏîÖÐÑ¡ÔñDcomÅäÖã¬ÕÒµ½Microsoft   excelÓ¦ÓóÌÐò£¬²ì¿´ÊôÐÔ
      °²È«Ñ¡ÏÖУ¬Æô¶¯È¨Ï޺ͷÃÎÊȨ ......

ѧϰasp.netµÄÁ÷³Ì

µÚÒ»²½¡¡ÕÆÎÕÒ»ÃÅ.NETÃæÏò¶ÔÏóÓïÑÔ£¬C#»òVB.NET ÎÒÇ¿ÁÒ·´¶ÔÔÚûϵͳѧ¹ýÒ»ÃÅÃæÏò¶ÔÏó(OO)ÓïÑÔµÄÇ°ÌáÏÂȥѧASP.NET¡£ ASP.NETÊÇÒ»¸öÈ«ÃæÏò¶ÔÏóµÄ¼¼Êõ£¬²»¶®OO£¬ÄǾø¶Ôѧ²»ÏÂÈ¥!
¡¡¡¡µÚ¶þ²½¡¡¶Ô.NET FrameworkÀà¿âÓÐÒ»¶¨µÄÁ˽⠿ÉÒÔͨ¹ý¿ª·¢Windows FormÓ¦ÓóÌÐòÀ´Ñ§Ï°.NET Framework¡£ASP.NETÊǽ¨¹¹ÔÚ.NET FrameworkÖ®É쵀 ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ