K
K
keith2011-05-04 20:37:09
ASP.NET
keith, 2011-05-04 20:37:09

[asp.net mvc] How to use routing outside the site?

Like having a static method like this:

public static void RegisterRoutes(RouteCollection routes)<br/>
 {<br/>
 routes.IgnoreRoute(&quot;{*favicon}&quot;, new { favicon = @&quot;(.*/)?favicon.ico(/.*)?&quot; });<br/>
 routes.IgnoreRoute(&quot;{resource}.axd/{*pathInfo}&quot;);<br/>
 routes.IgnoreRoute(&quot;{resource}.css/{*pathInfo}&quot;);<br/>
 routes.MapRoute(&quot;Root&quot;, &quot;&quot;, new { controller = &quot;home&quot;, action = &quot;index&quot; });<br/>
 routes.MapRoute(&quot;myRoute1&quot;, &quot;{controller}/{action}&quot;, new { controller = &quot;home&quot;, action = &quot;index&quot; });<br/>
 ...<br/>
 }<br/>

generate urls in console application where there is no HttpContext?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question