I have been trying to implement URL Routing in ASP.Net Web Forms (For the first time) with the help of a solution i found on a website [ download the solution ] . Route is working except my Start Page
.
For example , If I set Home.aspx
as start page, url is http://localhost:49200/Home.aspx
and other pages say, Modifications
appears as http://localhost:49200/Modifications
route works on other pages .
And if i set Modifications
as start page url becomes http://localhost:49200/Modifications.aspx
and Home
becomes http://localhost:49200/Home
.Why is that ??
Global.asax
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Routing;
using System.Web.Security;
using System.Web.SessionState;
namespace Test
{
public class Global : System.Web.HttpApplication
{
protected void Application_Start(object sender, EventArgs e)
{
RegisterRoutes(RouteTable.Routes);
}
static void RegisterRoutes(RouteCollection routes)
{
routes.MapPageRoute("Home", "Home","~/Home.aspx");
routes.MapPageRoute("Modifications", "Modifications","~/Modifications.aspx");
routes.MapPageRoute("AccountClosing", "AccountClosing","~/AccountClosing.aspx");
}
}
}
Do i need to do anything on config ?
menu is in '<%=ResolveUrl("~/Home") %>'
format.! Please help to solve this problem..