We help IT Professionals succeed at work.
Get Started

Web Forms Project -  Index Page In Subfolder

158 Views
Last Modified: 2016-01-26
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

Comment
Watch Question
The More I know, the more I don't know
CERTIFIED EXPERT
Distinguished Expert 2020
Commented:
This problem has been solved!
Unlock 1 Answer and 1 Comment.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE