I am new in Asp.net MVC. I am struck at my Customize URL Routing problem. I have created my Controller named "Customer" and action as "DisplayCustomer". In Global.asax.cs page,
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
namespace MvcApplication1
{
// Note: For instructions on enabling IIS6 or IIS7 classic mode,
// visit http://go.microsoft.com/?LinkId=9394801
public class MvcApplication : System.Web.HttpApplication
{
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
"Default", // Route name
"{controller}/{action}/{id}", // URL with parameters
new
{
controller = "Customer",
action = "DisplayCustomer",
id = UrlParameter.Optional
}); // Parameter defaults//, new { Code = @"\d{1001,1002}" }
}
protected void Application_Start()
{
AreaRegistration.RegisterAllAreas();
RegisterRoutes(RouteTable.Routes);
}
}
}
I don't know what wrong in it,it is always showing as
http://localhost:50415/Views/Customer/DisplayCustomer.aspx
not as
http://localhost:50415/Customer/DisplayCustomer
Am I missing something to make it this to work?