What is new in the ASP.NET 3.5 Extensions Preview

As I am sure you saw, we recently posted the ASP.NET 3.5 Extensions... I thought i'd do a brief introduction to some of the new features in this release by updating my mix07 demo MySilverlightTV...

Download the full sample here

MySilverlightTv(noVideos).zip (1.3MB)

Note, you can grab the "Data\Media" dir from the original one if you all the cool videos for a demo.

 

1.  Silverlight Support

We updated the old <asp:Media> control.. it is now called <asp:MediaPlayer>  here is an example usage:

image

 

This gives me a fully functioning media player that works on Firefox, Safri, IE, mac and windows.  I can chose from 10 or so stock templates for the look and feel or grab one and customize it in Expression (it is just a bunch of Xaml) to make it fit into my site..  Oh, and notice, there is no more click-to-activate and no client side JavaScript or Xaml coding required at all! 

image

 

Oh, I didn't use it in this demo, but we also renamed <asp:Xaml> to <asp:Silverlight>

Read more about these in the ASP.NET Silverlight quickstarts

 

2. AJAX Support

We updated the history support and integrated it more deeply into the product... This gives developers full control of the meaning of the browsers forward and back buttons within their applications.  Rather than the <asp:History> syntax, there is now a simple property on ScriptManager called "EnableHistory.  Notice I am also setting EnableStateHash to false as it makes debugging easier as it leaves the URL string human readable.. you may or may not want that in your site, so it is an option.   Then I set a server side method HistoryNavigate that handles the pushing stuff into the property bag when navigating away and pulling it out of the property bag when navigating into the page.

image

Then, any time your app process a user action that represents a change it state, you can add a history point this creates a new "backbutton" state. 

image

Then, each time the page is navigated, you get a chance to check out that state and initialize your controls based on it.  Notice after I update the controls, I kick the UpdatePanel to update as well.. 

image

Read more in the Ajax quickstarts..

 

3. MVC within a Web Site project

There have been a ton of great MVC samples... This one I wanted to try what is not considered a best practice, but it does help you learn what is going on with MVC and web site projects.    I wanted to quickly write an RSS feed of the video in my site.   I used the data model I already had for this site, then added a very simple controller...   Notice the nice clean URLs I get?  Notice how i can pass in arguments so that folks can build up customer feeds?   It is simple to build your just about anything you can do wit Linq..

image

But the best part?  Check out the RSS feedcode.. I litterally just grabbed the feed from my blog and parameterized it based on the ViewData..  One tip, notice I had to start he Xml on the SAME LINE as the Page directives.. the ensures there is no leading whitespace (which the RSS spec does not allow)...

image

Read my full post on this... RSS Feed with the new ASP.NET MVC Framework

 

 

4. Dynamic Data...

Ok, ok.. I didn't get a chance to add dynamic data to MySilverlightTV... but I still plan to.  In the mean time, check out Scott Hunter's new blog.. he introduces dynamic data and will be talking about it more in the future.  Also, check out the quickstarts for a very good overview.

 

Enjoy!