Posted By: Jonathan Carter | Mar 4th @ 8:30 PM | 53,381 Views | 10 Comments

In this episode of 10-4, we introduce another new feature of ASP.NET WebForms 4.0: Routing. The ASP.NET Routing engine was added in the .NET Framework 3.5 SP1 release and is heavily leveraged by both ASP.NET MVC and ASP.NET Dynamic Data to provide bi-directional routing functionality. With the release of ASP.NET WebForms 4.0, you can take full advantage of the common route engine that allows you to customize the URLs that your application exposes. In addition, new expression builders allow you to generate dynamic URLs that are based on your route definitions, alleviating you from having to hard code static links.

For more 10-4 episodes, be sure to visit:
http://channel9.msdn.com/shows/10-4

Visual Studio Topic Area on Channel 9:
http://channel9.msdn.com/VisualStudio

Visual Studio 2010 CTP VPC:
http://tinyurl.com/GetCTP

ASP.NET Routing:
http://msdn.microsoft.com/en-us/library/cc668201.aspx

10-4! Over and out!

Rating:
4
0
Ivannicoff
Ivannicoff
Ivannicoff
That is great! Will it be possible to have declarative syntax of it? For example in web.routing file?
JC can you tell about changes of App_Theme? I wrote about it on connect but no answer.
Ivannicoff
Ivannicoff
Ivannicoff

And about new rendering mode of controls.
Thank you.

Very well implemented very useful feature!
One question: what about urls localization?
Should I populate the RouteTable by hand for every languages or there is some resource related stuffs in the API?
Thx

Ivannicoff
Ivannicoff
Ivannicoff

Thank you JC! I wrote you some ideas a month ago.

Do the new route tools help in moving from a site with identity keys (int) to text values. 

products.aspx?pid=1
becomes
products/chairs/

I guess it would be difficult to map all the number / string pairs as routes in a config file.  I assume they could be added programatically on application start.  They would have to be recreated if something was later added to the database?

Or do you suggest moving away from passing the primary keys of database related objects and instead passing a unique string?

stevo_
stevo_
Human after all
3:05am to 8:41am

thats fast Tongue Out

i am using that really efficient

Microsoft Communities