10-4 Episode 11: Bi-Directional Routing with ASP.NET WebForms 4.0
- Posted: Mar 04, 2009 at 8:30 PM
- 60,388 Views
- 10 Comments
Loading User Information from Channel 9
Something went wrong getting user information from Channel 9
Loading User Information from MSDN
Something went wrong getting user information from MSDN
Loading Visual Studio Achievements
Something went wrong getting the Visual Studio Achievements
Right click “Save as…”
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!
Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation,
please create a new thread in our Forums,
or
Contact Us and let us know.
Follow the Discussion
Oops, something didn't work.
What does this mean?
Following an item on Channel 9 allows you to watch for new content and comments that you are interested in. You need to be signed in to Channel 9 to use this feature.What does this mean?
Following an item on Channel 9 allows you to watch for new content and comments that you are interested in and view them all on your notifications page.sign up for email notifications?
JC can you tell about changes of App_Theme? I wrote about it on connect but no answer.
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
As far as new rendering of controls, I'll deifnitely try to fit this in later episodes. Funny enough I actually showed off a very subtle change to the ListView control in this episode but I didn't call it out. You no longer have to have a PlaceHolderTemplate if your ItemTemplate's contents are truly seperate markup (i.e. not <li>'s within a <ul> for instance).
Feel free to email me (joncart at microsoft dot com) and I can share some additional info in the meantine.
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?
There is no need to get religious on either approach, it all just comes down to which approach serves the needs of your application the best. Since routing is so extensible, you should have fun building the sitemap you want. There is soooo much more to it then what I showed in this demo since this episode was meant only to show how routing and webforms can work together. General purpose routing has plenty of awesome little features.
I doubt there will be a 10-4 episode on ASP.NET Routing specifically since it isn't a feature in .NET Framework 4.0, but I could throw together some ad-hoc screencasts and plop them on my blog (http://www.lostintangent.com) or C9.
Keep these great questions coming guys, I seriously love the 10-4 community
thats fast
Great to hear!
Is there a source file included with demo?
I have been trying to run this and keep getting file not found error I am using VS2010 Beta 2
Remove this comment
Remove this thread
close