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

ASP.NETÖÐÖ´ÐÐURLÖØд

 
¿ÉÒÔʹÓà ISAPI ɸѡÆ÷ÔÚ IIS Web ·þÎñÆ÷¼¶±ðʵÏÖ URL ÖØд£¬Ò²¿ÉÒÔʹÓà HTTP Ä£¿é»ò HTTP ´¦Àí³ÌÐòÔÚ
ASP.NET ¼¶±ðʵÏÖ URL ÖØд¡£±¾ÎÄÖصã½éÉÜÈçºÎʹÓà ASP.NET ʵÏÖ URL ÖØд£¬Òò´ËÎÒÃǽ«²»¶ÔʹÓà ISAPI ɸѡÆ÷ʵÏÖ
URL ÖØдµÄϸ½Ú½øÐÐÉîÈë̽ÌÖ¡£µ«ÊÇ£¬ÓдóÁ¿µÄµÚÈý·½ ISAPI ɸѡÆ÷¿ÉÓÃÓÚ URL ÖØд£¬ÀýÈ磺
ISAPI
Rewrite

IIS Rewrite

PageXChanger

»¹ÓÐÐí¶àÆäËûµÄɸѡÆ÷£¡
ͨ¹ý System.Web.HttpContext
ÀàµÄ RewritePath()
·½·¨£¬¿ÉÒÔÔÚ ASP.NET ¼¶±ðʵÏÖ URL ÖØд¡£HttpContext

Àà°üº¬ÓйØÌض¨ HTTP ÇëÇóµÄ HTTP Ìض¨ÐÅÏ¢¡£¶ÔÓÚ ASP.NET ÒýÇæÊÕµ½µÄÿ¸öÇëÇ󣬾ùΪ¸ÃÇëÇó´´½¨Ò»¸ö HttpContext
ʵÀý¡£´ËÀà¾ßÓÐÈçÏÂÊôÐÔ£ºRequest
ºÍ Response
£¬Ìṩ¶Ô´«ÈëÇëÇóºÍ´«³öÏìÓ¦µÄ·ÃÎÊ£»Application
ºÍ Session
£¬Ìṩ¶ÔÓ¦ÓóÌÐòºÍ»á»°±äÁ¿µÄ·ÃÎÊ£»User
£¬ÌṩÓйØͨ¹ýÁËÉí·ÝÑéÖ¤µÄÓû§µÄÐÅÏ¢£»ÆäËûÏà¹ØÊôÐÔ¡£
ʹÓà RewritePath()

·½·¨¿ÉÒÔ½ÓÊܵ¥¸ö×Ö·û´®×÷ΪҪʹÓõÄз¾¶¡£HttpContext
ÀàµÄ RewritePath(string)

·½·¨ÔÚÄÚ²¿¶Ô Request
¶ÔÏóµÄ Path
ÊôÐÔºÍ QueryString
ÊôÐÔ½øÐиüС£³ýÁË RewritePath(string)
£¬.NET
Framework 1.1 »¹°üÀ¨ÁíÒ»ÖÖÐÎʽµÄ RewritePath()
·½·¨£¬´Ë·½·¨¿ÉÒÔ½ÓÊÜÈý¸ö×Ö·û´®ÊäÈë²ÎÊý¡£´Ë±¸ÓÃÖØÔØÐÎ
ʽ²»½öÒªÉèÖà Request
¶ÔÏóµÄ Path
ÊôÐÔºÍ QueryString

ÊôÐÔ£¬»¹ÒªÉèÖÃÄÚ²¿³ÉÔ±±äÁ¿£¬ÕâЩ±äÁ¿ÓÃÓÚ¼ÆËã Request
¶ÔÏóµÄ PhysicalPath
¡¢PathInfo
ºÍ FilePath
ÊôÐÔÖµ¡£
ÒªÔÚ ASP.NET ÖÐʵÏÖ URL ÖØд£¬ÐèÒª´´½¨ HTTP Ä£¿é»ò HTTP
´¦Àí³ÌÐò£¬ÒÔ±ãÍê³ÉÒÔϲÙ×÷£º
¼ì²é±»ÇëÇóµÄ·¾¶£¬ÒÔÈ·¶¨ URL ÊÇ·ñÐèÒªÖØд¡£
Èç¹ûÐèÒªÖØд£¬Í¨¹ýµ÷Óà RewritePath()
·½·¨À´ÖØд·¾¶¡£
ÀýÈ磬¼ÙÉèÎÒ
ÃǵÄÍøÕ¾Öаüº¬Ã¿¸öÔ±¹¤Í¨¹ý /info/employee.aspx?empID=employeeID ¾ù¿É·ÃÎʵÄÐÅÏ¢¡£ÎªÁËʹ URL
¿ÉÒÔ¸ü¶àµØ±»“ɾ½Ú”£¬ÎÒÃÇ¿ÉÒÔ¾ö¶¨Í¨¹ýÒÔϵØÖ·À´·ÃÎÊÔ±¹¤Ò³Ã棺/people/EmployeeName.aspx¡£Õâ¾ÍÊÇÎÒÃÇҪʹÓà URL
ÖØдµÄÒ»¸öÀý×Ó¡£Ò²¾ÍÊÇ˵£¬ÔÚÇëÇó /people/ScottMitchell.aspx Ò³Ãæʱ£¬ÎÒÃÇÒªÖØд¸Ã URL£¬ÒÔ±ãʹÓÃ
/info/employee.aspx?empID=1001 Ò³Ãæ¡£
ʹÓà HTTP Ä£¿éÖ´ÐÐ URL ÖØд
ÔÚ
ASP.NET ¼¶±ðÖ´ÐÐ URL ÖØдʱ£¬¿ÉÒÔʹÓà HTTP Ä£¿é»ò HTTP ´¦Àí³ÌÐòÀ´Ö´ÐÐÖØд¡£Ê¹Óà HTTP
Ä£¿éʱ£¬±ØÐë¾ö¶¨ÔÚÇëÇóÓÐЧÆ


Ïà¹ØÎĵµ£º

ASP.NET AJAX¿Í»§¶Ë±à³ÌÖ®Âã¨Ò»£©

ÕªÒª
      ±¾ÎĽ«Ê×ÏȽéÉÜÒ»ÏÂÎÄÕµÄд×÷±³¾°ºÍÓõ½µÄÏà¹Ø¼¼Êõ¡£È»ºó½«·Ö±ðʹÓÃÆÓËصÄAjax¼¼ÊõºÍASP.NET AJAX¿ò¼Ü·Ö±ðʵÏÖ¾­µäµÄ“Hello£¡XX”£¬Í¨¹ýÁ½¸öСÀý×Ó£¬Ê¹ÅóÓÑÃǶÔÕâ¸ö¿ò¼ÜµÄÌصãºÍ¿ò¼ÜµÄʹÓ÷½·¨ÓÐÒ»¸ö³õ²½µÄÈÏʶ¡£
Ç°ÑÔ
      ÎÒÏ룬Èç¹û½ñÌìÄ ......

ASP.NET LINQ _1

 Ê²Ã´ÊÇLINQ?
       LINQÊÇÓïÑÔ¼¯³É²éѯ(Language Integrated Query)µÄ¼ò³Æ£¬ÊÇVisual Studio 2008 ºÍ.NET Framework 3.5 °æÖÐÒ»Ïî,Í»ÆÆÐԵĴ´Ð£¬ËüÔÚ¶ÔÏóÁìÓòºÍÊý¾ÝÁìÓòÖ®¼ä¼ÜÆðÁËÒ»×ùÇÅÁº.
       Ò»¸ö¼òµ¥LINQ²éѯ£º
    &n ......

ASP.NETÄ£ÄâÖ¸¶¨ÕʺÅȨÏÞ, ɾ³ý·Ç±¾»úͼƬÎļþ

 ËµÃ÷: Ö´Ðе±Ç° Web ÇëÇóÆڼ䣬³öÏÖδ´¦ÀíµÄÒì³£¡£Çë¼ì²é¶ÑÕ»¸ú×ÙÐÅÏ¢£¬ÒÔÁ˽âÓйظôíÎóÒÔ¼°´úÂëÖе¼Ö´íÎóµÄ³ö´¦µÄÏêϸÐÅÏ¢¡£
Òì³£ÏêϸÐÅÏ¢: System.ArgumentException: ²»Ö§³Ö URI ¸ñʽ¡£
Ô´´íÎó:
ÐÐ 30: protected void BTNCLick(object sender, EventArgs e)
ÐÐ 31: {
ÐÐ 32: System.IO. ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ