ASP.NET URLË«Ïò¸ÄдµÄʵÏÖ
ASP.NET URLË«Ïò¸ÄдµÄʵÏÖ
¡¡¡¡ÎÒÃÇÔÚ½øÐÐWeb³ÌÐò¿ª·¢Ê±£¬ÎªÁ˽øÐÐËÑË÷ÒýÇæÓÅ»¯£¨SEO£©£¬ÍùÍùÐèÒª¶ÔwebµÄ·ÃÎʵØÖ·½øÐÐÓÅ»¯£¬È罫http://localhost/Default.aspx?tab=performanceÐÞ¸ÄΪhttp://localhost/Default_performance.aspx£¬ºóÒ»¸öµØÖ·Äܹ»¸üºÃµØ±»ËÑË÷ÒýÇæËÑË÷µ½£¬´Ó¶ø´ïµ½ÁËËÑË÷ÒýÇæÓÅ»¯µÄÄ¿µÄ¡£Î¢ÈíÓÐÒ»¸ö¿ªÔ´Àà¿âURLRewriter¿ÉÒԷdz£·½±ãµØʵÏÖurl¸Äд£¬Í¨¹ýÅäÖÃÔÚweb.configÎļþÖеÄÓ³Éä±í½«Óû§µÄÇëÇóÖض¨Ïòµ½¾ßÌåµÄÒ³ÃæÖУ¬ÎÒÔړʹÓÃURLRewriter½øÐÐURLÖØдʧЧ”Ò»ÎÄÖÐÏêϸ½éÉÜÁËÈçºÎʹÓÃÕâ¸öÀà¿â£¬¸ÃÀà¿âÊÇͨ¹ýasp.netµÄhttpmodules»òhttphandlesÀ´Ö´Ðеģ¬µ«Èç¹ûÍøÕ¾µÄËÞÖ÷·þÎñÆ÷²»Ö§³Öasp.net httpmodulesºÍhttphandles£¬Ôò¸Ã¹¦ÄܱãʧЧÁË£¬ÕâʱÎÒÃÇ¿ÉÒÔͨ¹ýglobalÖеÄapplication_beginrequestʼþÀ´½øÐÐurlÖض¨Ïò¡£±¾ÎÄÔÚURLRewriterÀà¿âµÄ»ù´¡ÉϽøÐÐÁ˸Ľø£¬²¢¸ø³öÁËÒ»¸öÏà¶ÔÍêÕûµÄ½â¾ö·½°¸¡£
¡¡¡¡ÎÒÃǵĸĽøÊǽ¨Á¢ÔÚURLRewriterµÄ»ù´¡Ö®Éϵģ¬ËùÒÔURLRewriterÔÓеĶ«Î÷Ö»ÒªÄÜÓã¬ÎÒÃǶ¼¿ÉÒÔÖ±½ÓÄùýÀ´£¬µ±È»£¬²»ºÃµÄ¶«Î÷ÒªÞðÆú£¡
¡¡¡¡URLRewriterµÄÓ³Éä±íÊÇÖ±½ÓдÔÚweb.configÎļþÖеģ¬ÒªÈÃweb.configÄÜʶ±ðÓ³Éä±í£¬±ØÐëÔÚconfigSections½ÚÖÐÌí¼Ósection£¬¸æËß³ÌÐòÈçºÎÕýÈ·½âÎöweb.configÖÐδ±»Ê¶±ðµÄÄÚÈÝ£¬ÈçÔURLRewriter¾ÍÐèÒªÔÚweb.configÖÐÌí¼Ó<section name="RewriterConfig" type="URLRewriter.Config.RewriterConfigSerializerSectionHandler, URLRewriter"/>¡£ÎÒ¾õµÃÕâ¸ö·½Ê½²¢²»ºÃ£¬Ê×ÏÈÄãÐèÒªµ¥¶ÀÈ¥±àдһ¸öÀà¿âÀ´½âÎöxml£¬²¢ÔÚweb.configÖнøÐÐÅäÖã¬ÎÒÃÇÍêÈ«¿ÉÒÔÊ¡È¥ÕâÒ»²½¡£urlµÄÓ³Éä±í¿ÉÒÔµ¥¶Àдµ½Ò»¸öxmlÎļþÖУ¬µ±³ÌÐòÔËÐÐʱ½«xml¼ÓÔص½Ó¦ÓóÌÐò»º´æÖУ¬²¢ÉèÖÃÒ»¸ö»º´æÎļþÒÀÀµÏÕâÑùÿµ±¹ÜÀíÔ±ÐÞ¸ÄÍêÓ³Éä±íºó¾Í¿ÉÒÔÂíÉÏÉúЧ¡£
¡¡¡¡ÁíÍâÎÒÏ£ÍûÖ§³ÖurlµÄË«Ïò¸Äд£¬¼´ÉÏÃæÌáµ½µÄÁ½¸öurl£¬µ±Óû§ÊäÈëµÚ¶þ¸öurlʱ³ÌÐò»á½«ÇëÇó·¢Ë͵½µÚÒ»¸öurl£¬µ«ä¯ÀÀÆ÷ÖÐÏÔʾµÄurl²»±ä£»µ±Óû§ÊäÈëµÚÒ»¸öurlʱ£¬×Ô¶¯Ìøתµ½µÚ¶þ¸öurl£¬´Ëʱä¯ÀÀÆ÷ÖÐÏÔʾµÄÊǵڶþ¸öurl£¬µ«ÊÇÇëÇóÈÔÈ»ÊǵÚÒ»¸öurl¡£ÌýÆðÀ´ÊDz»ÊÇÓеãÈÆ°¡£¿Ã»¹Øϵ£¬ÆäʵҲºÜ¼òµ¥£¬»ù±¾µÄÐèÇó¾ÍÊÇ˵¿Í»§ÔÀ´ÍøÕ¾ÖеĺܶàÒ³ÃæÔÚ·ÃÎÊʱ¶¼´øÁ˺ܶà²ÎÊý£¬×öurl¸Äдʱ¶¼»»³ÉеÄurlÁË£¬Õâʱ¾ÉµÄurlÈÔÈ»¿ÉÒÔÓ㬿ͻ§ÏëµÄ¾ÍÊǵ±ÊäÈëÔÀ´¾ÉµÄurlʱÄÜ×Ô¶¯Ìøתµ½ÐµÄurl¡£Õâ¸ö¾ÍÊÇurlµÄË«Ïò¸Äд£¡ÕâÁ½ÖÖ·½Ê½¿ÉÒÔ·Ö±ðͨ¹ýContext.RewritePath()ºÍContext
Ïà¹ØÎĵµ£º
×òÌì¾ÍÒµ²¿Ò»ÃÀÅ®ÀÏʦÔÚQQÉÏ´þµ½ÎÒ£¬ÎÊÎÒÊDz»ÊÇ×ö¹ýVBScript£¬²¢²»ÓÉ·Ö˵°ÑÎÒQQ¸æËßÁËÒ»¸öÔÚÍâµØ¹¤×÷µÄѧÉú£¬ÈÃËýÀ´×ÉѯÎÒ£¬Ã»°ì·¨ÁË£¬Ó²×ÅͷƤÕÒÕÒ½â¾ö·½·¨¡£
ÔÀ´ÕâλÈí¼þ¹¤³ÌʦËùÔÚµÄÏîÄ¿×éÒª×öÒ»¸ö“¸ú΢Èí²î²»¶àµÄÔ¶³ÌWeb½çÃæÁ¬½Ó”£¬´ó¸ÅÏîÄ¿¾ÀíÊÇÕâô°²Åŵģº“Ëû˵ÓÃJavascriptʵÏֵŦÄÜûÓÐÄÇô ......
Ê×ÏÈ¿´ÏÂXML½á¹¹
<?xml version="1.0" encoding="utf-8"?>
<corplist>
<corp>
<linkname>³ÂÏÈÉú</linkname>
<corpname>XXXXXXXXX¹«Ë¾</corpname>
<email>xxxxx@126.com</email>
</corp>
<corp>
<linknam ......
ÔÚÕâÀïÎÒÃǽ«½²ÊöASP.NET Routing¶ÔÇëÇóµÄ²»Í¬´¦Àí¡£ÎÄÕ½«´Ó´¦Àí»úÖÆ·½Ã濪ʼ½²Æð£¬È»ºó½²Êö¼àÌýµÄ¹ý³Ì¡£Ï£Íû±¾ÎÄÄܶԴó¼ÒÓÐËù°ïÖú¡£
ASP.NET RoutingÊÇÒ»¸öͨÓõÄ×é¼þ£¬Ëü²»Éæ¼°µ½ÈκξßÌåµÄÇëÇó´¦Àí·½Ê½¡£Èç¹ûÄúÐèÒª£¬Ò²¿ÉÒÔ×Ô¼º»ùÓÚËü½øÐпª·¢——ÈçFubuMvcÏîÄ¿¾ÍÊÇÕâô×öµÄ¡£
Ê×ÏÈ£¬Èç¹ûÄúÐèÒªÔÚÏîÄ ......
Äú¿ÉÒÔʹÓà Xml Web ·þÎñÆ÷¿Ø¼þÀ´ÏÔʾ XML ÎĵµµÄÄÚÈÝ£¬ÇÒ²»ÐèÒª½øÐиñʽ»¯»òʹÓà XSL ת»»¡£
Ò»¡¢·½°¸
Xml Web ·þÎñÆ÷¿Ø¼þ¶ÁÈ¡ XML ²¢½«ÆäдÈë¸Ã¿Ø¼þËùÔÚµÄ ASP.NET ÍøÒ³¡£Èç¹û½« XSL ת»» (XSLT) Ó¦Óõ½ XML£¬Ôò×îÖÕת»»µÄÊä³ö½«³ÊÏÖÔÚ¸ÃÒ³ÖС£
¶þ¡¢±³¾°
Äú¿ÉÒÔʹÓà XML Web ·þÎñÆ÷¿Ø¼þ½« XML Îĵµ ......
ASP.NET MVCµÄ1.0·¢ÐÐ˵Ã÷
×îÐÂÏûÏ¢
ASP.NET MVCµÄ1.0ÊÇASP.NET MVC¿ò¼ÜµÄµÚÒ»¸öÕýʽ°æ±¾µÄÖ§³Ö¡£ÓëÍù³£Ò»Ñù£¬ËæʱÌṩÓйØASP.NET MVCµÄÂÛ̳·´À¡¡£
×¢Ò⣺ÔÚÔËÐеÄASP.NET MVC 1.0°²×°³ÌÐò£¬Ð¶ÔØÈκÎÔçÆÚÔ¤ASP.NET MVCµÄ·¢Ðа汾¡£´ËÍ⣬¹Ø±ÕVisual Studio 2008µÄËùÓÐʵÀý¡£
Îĵµ
ASP.NET MVCÖеÄÎļþ¿ÉÔÚMSD ......