Aseem Bhardwaj

Aseem Bhardwaj

  • 1.6k
  • 114
  • 20.6k

url routing code not working in global.asax

Sep 17 2016 6:15 AM
friends following code is note working:---
please correct it or give me an optimal code
<%@ Application Language="C#" %>
<%@ Import Namespace="decentSoftwareServices" %>
<%@ Import Namespace="System.Web.Optimization" %>
<%@ Import Namespace="System.Web.Routing" %>


<script runat="server">

void Application_Start(object sender, EventArgs e)
{
RegisterRoutes(RouteTable.Routes);
// Code that runs on application startup
  BundleConfig.RegisterBundles(BundleTable.Bundles);
AuthConfig.RegisterOpenAuth();
}

void Application_End(object sender, EventArgs e)
{
// Code that runs on application shutdown

}

void Application_Error(object sender, EventArgs e)
{
// Code that runs when an unhandled error occurs

}
public static void RegisterRoutes(RouteCollection routes)
{
routes.MapPageRoute("index", "index", "~/guest/index.aspx");
routes.MapPageRoute("contact", "contact", "~/guest/contactUs.aspx");
}

</script>


Answers (7)