I want that when we types “http://localhost/View/View Student/”, it goes to the “Student” Controller and invokes the DisplayStudentaction. Please give me solution, how to map this action with controller,when we types a such type url.
For solving above problem, we have adding an entry in to the routes collection using the maproute function. In Below i have underlined code which shows how the URL structure and mapping with controller and action is defined.
routes.MapRoute( "View", // Route name "View/ViewStudent/{id}", // URL with parameters new { controller = "Student", action = "DisplayStudent", id = UrlParameter.Optional });
Markdown for AI
A clean, structured version of this page for AI assistants and LLMs.
We use cookies to ensure you have the best browsing experience on our website. By using our site, you
acknowledge that you have read and understood our
Cookie Policy &
Privacy Policy.
Can you answer this question?
Write Answer1 Answers