Link to home
Start Free TrialLog in
Avatar of Puzzled_Dev
Puzzled_DevFlag for United States of America

asked on

Web Forms Project - Index Page In Subfolder

Background:
The project is an ASP.NET Web Forms site.  
It is currently in the process of attempting to support a hybrid MVC model.  
The new index page now resides in a subfolder.  

Question: I was wondering if its possible to add a route to the RouteCollection in order to use the index in the sub folder as the landing page?  I realize "Default Document" is an IIS setting but was wondering if there was a way to over ride this.  I'm trying to avoid making the index an HTTPRedirect/JS Redirect/Response.Redirect.

www.mysite.com --> ~/Account/Index.aspx
instead of
www.mysite.com --> Index.aspx

I have tried the following with no success:

Using System.Web.Routing
protected void Application_Start(object sender, EventArgs e)  {

// routeCollection.MapPageRoute("Default", "", "~/Account/Index.aspx");
// routeCollection.Add("Default", new Route(string.Empty, new PageRouteHandler("~/Account/Index.aspx")));
}

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of David Johnson, CD
David Johnson, CD
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial