URL Routing with ASP.NET 4 Web Forms (VS 2010 and .NET 4.0 Series)
page 3 of 8
by Scott Guthrie
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 32401/ 55

Mapping URLs using ASP.NET MVC

The URL Routing engine introduced with ASP.NET 3.5 SP1 provides a powerful way to handle incoming URLs.  Typically you write code as part of application startup to register/map URLs that match a specific URL format to code handlers. 

Below is an example of how you can use ASP.NET MVC today to map the /products/software URL to a controller class called “Products” that has an action method named “Browse”:

Figure 1

The first “products-browse” parameter to the MapRoute() helper method above is a friendly name for the route.  The second “products/{category}” parameter is the URL filter that matches the /products/software URL – and which treats the second segment of the URL as a parameter value called “category”.  This parameter will then be passed to the ProductsController’s Browse() action method to process.

View Entire Article

User Comments

Title: What about ASP.NET 3.5   
Name: Nicachipal
Date: 2011-02-08 11:08:29 AM
Do we have something similar in ASP.NET 3.5 ?
Title: introduction to asp.net 4.0   
Name: Abdul Sami
Date: 2010-01-06 4:13:44 AM
See if this article can help you people on asp.net 4.0 features


Product Spotlight
Product Spotlight 

Community Advice: ASP | SQL | XML | Regular Expressions | Windows

©Copyright 1998-2024 ASPAlliance.com  |  Page Processed at 2024-06-18 5:43:48 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search