首页 新闻 搜索 专区 学院

ASP.NET MVC UrlRoutingModule

0
悬赏园豆:50 [已关闭问题]
<pre><span style="color: #1000a0;">public</span> <span style="color: #1000a0;">virtual</span> <a title="System.Void" href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Void"><span style="color: #0066cc;">void</span></a> <strong><a class="bold" href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Routing:3.5.0.0:31bf3856ad364e35/System.Web.Routing.UrlRoutingModule/PostResolveRequestCache(System.Web.HttpContextBase)"><span style="color: #0066cc;">PostResolveRequestCache</span></a></strong>(<a title="System.Web.HttpContextBase" href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Abstractions:3.5.0.0:31bf3856ad364e35/System.Web.HttpContextBase"><span style="color: #0066cc;">HttpContextBase</span></a> context) { <a title="System.Web.Routing.RouteData" href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Routing:3.5.0.0:31bf3856ad364e35/System.Web.Routing.RouteData"><span style="color: #0066cc;">RouteData</span></a> <strong>routeData</strong> = <span style="color: #1000a0;">this</span>.<a title="RouteCollection System.Web.Routing.UrlRoutingModule.RouteCollection { ... }" href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Routing:3.5.0.0:31bf3856ad364e35/System.Web.Routing.UrlRoutingModule/property:RouteCollection:System.Web.Routing.RouteCollection"><span style="color: #0066cc;">RouteCollection</span></a>.<a title="RouteData System.Web.Routing.RouteCollection.GetRouteData(HttpContextBase httpContext);" href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Routing:3.5.0.0:31bf3856ad364e35/System.Web.Routing.RouteCollection/GetRouteData(System.Web.HttpContextBase):System.Web.Routing.RouteData"><span style="color: #0066cc;">GetRouteData</span></a>(<a title="HttpContextBase context; // Parameter">context</a>); <span style="color: #1000a0;">if</span> (<a title="RouteData routeData // Local Variable">routeData</a> != <span style="color: #800000;">null</span>) { <a title="System.Web.Routing.IRouteHandler" href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Routing:3.5.0.0:31bf3856ad364e35/System.Web.Routing.IRouteHandler"><span style="color: #0066cc;">IRouteHandler</span></a> <strong>routeHandler</strong> = <a title="RouteData routeData // Local Variable">routeData</a>.<a title="IRouteHandler System.Web.Routing.RouteData.RouteHandler { ... }" href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Routing:3.5.0.0:31bf3856ad364e35/System.Web.Routing.RouteData/property:RouteHandler:System.Web.Routing.IRouteHandler"><span style="color: #0066cc;">RouteHandler</span></a>; <span style="color: #1000a0;">if</span> (<a title="IRouteHandler routeHandler // Local Variable">routeHandler</a> == <span style="color: #800000;">null</span>) { <span style="color: #1000a0;">throw</span> <span style="color: #1000a0;">new</span> <a title="System.InvalidOperationException.InvalidOperationException(string);" href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.InvalidOperationException/.ctor(String)"><span style="color: #0066cc;">InvalidOperationException</span></a>(<a title="System.String" href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.String"><span style="color: #0066cc;">string</span></a>.<a title="string System.String.Format(IFormatProvider, string, object[]);" href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.String/Format(System.IFormatProvider,String,Object%5b%5d):String"><span style="color: #0066cc;">Format</span></a>(<a title="System.Globalization.CultureInfo" href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Globalization.CultureInfo"><span style="color: #0066cc;">CultureInfo</span></a>.<a title="CultureInfo System.Globalization.CultureInfo.CurrentUICulture { ... }" href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Globalization.CultureInfo/property:CurrentUICulture:System.Globalization.CultureInfo"><span style="color: #0066cc;">CurrentUICulture</span></a>, <a title="System.Web.Resources.RoutingResources" href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Routing:3.5.0.0:31bf3856ad364e35/System.Web.Resources.RoutingResources"><span style="color: #0066cc;">RoutingResources</span></a>.<a title="string System.Web.Resources.RoutingResources.UrlRoutingModule_NoRouteHandler { ... }" href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Routing:3.5.0.0:31bf3856ad364e35/System.Web.Resources.RoutingResources/property:UrlRoutingModule_NoRouteHandler:String"><span style="color: #0066cc;">UrlRoutingModule_NoRouteHandler</span></a>, <span style="color: #1000a0;">new</span> <a title="System.Object" href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Object"><span style="color: #0066cc;">object</span></a>[<span style="color: #800000;">0</span>])); } <span style="color: #1000a0;">if</span> (!(<a title="IRouteHandler routeHandler // Local Variable">routeHandler</a> <span style="color: #1000a0;">is</span> <a title="System.Web.Routing.StopRoutingHandler" href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Routing:3.5.0.0:31bf3856ad364e35/System.Web.Routing.StopRoutingHandler"><span style="color: #0066cc;">StopRoutingHandler</span></a>)) { <a title="System.Web.Routing.RequestContext" href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Routing:3.5.0.0:31bf3856ad364e35/System.Web.Routing.RequestContext"><span style="color: #0066cc;">RequestContext</span></a> <strong>requestContext</strong> = <span style="color: #1000a0;">new</span> <a title="System.Web.Routing.RequestContext.RequestContext(HttpContextBase httpContext, RouteData routeData);" href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Routing:3.5.0.0:31bf3856ad364e35/System.Web.Routing.RequestContext/.ctor(System.Web.HttpContextBase,System.Web.Routing.RouteData)"><span style="color: #0066cc;">RequestContext</span></a>(<a title="HttpContextBase context; // Parameter">context</a>, <a title="RouteData routeData // Local Variable">routeData</a>); <a title="System.Web.IHttpHandler" href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web:2.0.0.0:b03f5f7f11d50a3a/System.Web.IHttpHandler"><span style="color: #0066cc;">IHttpHandler</span></a> <strong>httpHandler</strong> = <a title="IRouteHandler routeHandler // Local Variable">routeHandler</a>.<a title="IHttpHandler System.Web.Routing.IRouteHandler.GetHttpHandler(RequestContext requestContext);" href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Routing:3.5.0.0:31bf3856ad364e35/System.Web.Routing.IRouteHandler/GetHttpHandler(System.Web.Routing.RequestContext):System.Web.IHttpHandler"><span style="color: #0066cc;">GetHttpHandler</span></a>(<a title="RequestContext requestContext // Local Variable">requestContext</a>); <span style="color: #1000a0;">if</span> (<a title="IHttpHandler httpHandler // Local Variable">httpHandler</a> == <span style="color: #800000;">null</span>) { <span style="color: #1000a0;">throw</span> <span style="color: #1000a0;">new</span> <a title="System.InvalidOperationException.InvalidOperationException(string);" href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.InvalidOperationException/.ctor(String)"><span style="color: #0066cc;">InvalidOperationException</span></a>(<a title="System.String" href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.String"><span style="color: #0066cc;">string</span></a>.<a title="string System.String.Format(IFormatProvider, string, object[]);" href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.String/Format(System.IFormatProvider,String,Object%5b%5d):String"><span style="color: #0066cc;">Format</span></a>(<a title="System.Globalization.CultureInfo" href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Globalization.CultureInfo"><span style="color: #0066cc;">CultureInfo</span></a>.<a title="CultureInfo System.Globalization.CultureInfo.CurrentUICulture { ... }" href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Globalization.CultureInfo/property:CurrentUICulture:System.Globalization.CultureInfo"><span style="color: #0066cc;">CurrentUICulture</span></a>, <a title="System.Web.Resources.RoutingResources" href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Routing:3.5.0.0:31bf3856ad364e35/System.Web.Resources.RoutingResources"><span style="color: #0066cc;">RoutingResources</span></a>.<a title="string System.Web.Resources.RoutingResources.UrlRoutingModule_NoHttpHandler { ... }" href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Routing:3.5.0.0:31bf3856ad364e35/System.Web.Resources.RoutingResources/property:UrlRoutingModule_NoHttpHandler:String"><span style="color: #0066cc;">UrlRoutingModule_NoHttpHandler</span></a>, <span style="color: #1000a0;">new</span> <a title="System.Object" href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Object"><span style="color: #0066cc;">object</span></a>[] { <a title="IRouteHandler routeHandler // Local Variable">routeHandler</a>.<a title="Type System.Object.GetType();" href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Object/GetType():System.Type"><span style="color: #0066cc;">GetType</span></a>() })); } <a title="HttpContextBase context; // Parameter">context</a>.<a title="IDictionary System.Web.HttpContextBase.Items { ... }" href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Abstractions:3.5.0.0:31bf3856ad364e35/System.Web.HttpContextBase/property:Items:System.Collections.IDictionary"><span style="color: #0066cc;">Items</span></a>[<a title="object System.Web.Routing.UrlRoutingModule._requestDataKey;" href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Routing:3.5.0.0:31bf3856ad364e35/System.Web.Routing.UrlRoutingModule/_requestDataKey:Object"><span style="color: #0066cc;">_requestDataKey</span></a>] = <span style="color: #1000a0;">new</span> <a title="System.Web.Routing.UrlRoutingModule+RequestData.RequestData();" href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Routing:3.5.0.0:31bf3856ad364e35/System.Web.Routing.UrlRoutingModule.RequestData/.ctor()"><span style="color: #0066cc;">RequestData</span></a> { <a title="string System.Web.Routing.UrlRoutingModule+RequestData.OriginalPath { ... }" href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Routing:3.5.0.0:31bf3856ad364e35/System.Web.Routing.UrlRoutingModule.RequestData/property:OriginalPath:String"><span style="color: #0066cc;">OriginalPath</span></a> = <a title="HttpContextBase context; // Parameter">context</a>.<a title="HttpRequestBase System.Web.HttpContextBase.Request { ... }" href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Abstractions:3.5.0.0:31bf3856ad364e35/System.Web.HttpContextBase/property:Request:System.Web.HttpRequestBase"><span style="color: #0066cc;">Request</span></a>.<a title="string System.Web.HttpRequestBase.Path { ... }" href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Abstractions:3.5.0.0:31bf3856ad364e35/System.Web.HttpRequestBase/property:Path:String"><span style="color: #0066cc;">Path</span></a>, <a title="IHttpHandler System.Web.Routing.UrlRoutingModule+RequestData.HttpHandler { ... }" href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Routing:3.5.0.0:31bf3856ad364e35/System.Web.Routing.UrlRoutingModule.RequestData/property:HttpHandler:System.Web.IHttpHandler"><span style="color: #0066cc;">HttpHandler</span></a> = <a title="IHttpHandler httpHandler // Local Variable">httpHandler</a> }; <a title="HttpContextBase context; // Parameter">context</a>.<a title="void System.Web.HttpContextBase.RewritePath(string);" href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Abstractions:3.5.0.0:31bf3856ad364e35/System.Web.HttpContextBase/RewritePath(String)"><span style="color: #0066cc;">RewritePath</span></a>(<span style="color: #800000;">"~/UrlRouting.axd"</span>); } } } 这行 <a title="HttpContextBase context; // Parameter">context</a>.<a title="void System.Web.HttpContextBase.RewritePath(string);" href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Abstractions:3.5.0.0:31bf3856ad364e35/System.Web.HttpContextBase/RewritePath(String)"><span style="color: #0066cc;">RewritePath</span></a>(<span style="color: #800000;">"~/UrlRouting.axd"</span>); 为什么要.<a title="void System.Web.HttpContextBase.RewritePath(string);" href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://System.Web.Abstractions:3.5.0.0:31bf3856ad364e35/System.Web.HttpContextBase/RewritePath(String)"><span style="color: #0066cc;">RewritePath</span></a>到 <span style="color: #800000;">"~/UrlRouting.axd</span>,有什么意义!!</pre>
Michael-Chen的主页 Michael-Chen | 初学一级 | 园豆:2
提问于:2009-09-14 18:24
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册