10-4 Episode 11: Bi-Directional Routing with ASP.NET WebForms 4.0
- Posted: Mar 04, 2009 at 8:30 PM
- 60,012 Views
- 10 Comments
Download
How do I download the videos?
- To download, right click the file type you would like and pick “Save target as…” or “Save link as…”
Why should I download videos from Channel9?
- It's an easy way to save the videos you like locally.
- You can save the videos in order to watch them offline.
- If all you want is to hear the audio, you can download the MP3!
Which version should I choose?
- If you want to view the video on your PC, Xbox or Media Center, download the High Quality WMV file (this is the highest quality version we have available).
- If you'd like a lower bitrate version, to reduce the download time or cost, then choose the Medium Quality WMV file.
- If you have a Zune, WP7, iPhone, iPad, or iPod device, choose the low or medium MP4 file.
- If you just want to hear the audio of the video, choose the MP3 file.
Right click “Save as…”
- High Quality WMV (PC, Xbox, MCE)
- MP3 (Audio only)
- MP4 (iPod, Zune HD)
- Mid Quality WMV (Lo-band, Mobile)
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 Closed
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
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