Note that there are some explanatory texts on larger screens.

plurals
  1. POCan ASP.NET MVC routing and a classic ASP homepage (VBScript, not web forms) play together nicely?
    primarykey
    data
    text
    <p>We have a classic VBScript "default.asp" page in the root of our site. (This is a heavy, legacy page and converting it is not an option right now.) We also have a new ASP.NET MVC 2 application we want to host on the same site. Everything actually works great together! Except for one thing: requests to the root of the site (e.g., <code>/</code>) get picked up by the MVC routing (which then wants to display the HomeController's Index action) instead of letting the default.asp page take the request!</p> <p>This is what I would like:<br /> <a href="http://www.example.com/" rel="nofollow">http://www.example.com/</a> &lt;- should execute the classic default.asp page, not /Home/Index!</p> <p>I can't figure out how to <em>not</em> execute <code>HomeController.Index()</code>. If I remove the HomeController, I get an error. If I try to IgnoreRoute("") I get an error. I have even changed the priority/order of the "default document" in IIS for this site to treat "default.asp" as the preferred document. I've even deleted the dummy MVC "default.aspx" page out of the root, and still the MVC routing is "stealing" requests for the root of the site.</p> <p>The temporary solution is for me to have HomeController.Index redirect the user back to "default.asp". This works, but then it shows up ugly and visible in the address bar,<br /> <a href="http://www.example.com/default.asp" rel="nofollow">http://www.example.com/default.asp</a> &lt;- not what I want to show.</p> <p>Any suggestions/answers on how to get these both to co-exist? Perhaps something I can add to web.config to make this specific exception for the homepage? Thank you!</p> <h3>UPDATE</h3> <p>I apologize for the delay in getting back to this but it went on the back burner for a while and I honestly almost forgot about this; however I did manage to get this working! I'd like to give credit to both Chris Marisic and Chance, since combined they helped me figure this out.</p> <p>The problem was that sure enough, it seems there was a default route (as Chance suggested in a comment) that was catching these requests to the site root. </p> <p>So, by tweaking this, and also adding <code>routes.IgnoreRoute("");</code> (empty-string) as the first rule in my routing list, this now works! </p> <p>Thank you everyone for your help!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload