Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Route Config File in MVC

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 356
    Comment on it

    In MVC project whenever we run the application we have default form to be run.

    To setting up or changing up the startup view in MVC project we have entry in the Route.config file for the default view associated with the controller

    For Ex:
     routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
    
                routes.MapRoute(
                    "Default",                                       // Route name
                    "{controller}/{action}/{id}",                   // URL with parameters
            new { controller = "Home", action = "Index", id = "" }  // Parameter default 
    

    In this example we have Home controller in which there is an index view to be invoked by default when the application gets run on the browser

    We can change the controller and the view according to the user need and by default that view will be fired from the specified controller

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: