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!

Published 09 December 07 10:35 by BradA

Comments

# Untitled 1 said on December 10, 2007 2:35 AM:

PingBack from http://www.absolutely-people-search.info/?p=5061

# Around and About .NET World said on December 10, 2007 4:47 AM:

Altre risorse su ASP .NET 3.5 Extensions

# Jirapong said on December 10, 2007 4:48 AM:

Hi Brad,

Congratulation on MVC related. i can't wait to develop application on it.

I have a question, Is MS MVC provide Silverlight 1.1 or 2.0 ViewEngine?

Thanks,

-Jirapong

# Jirapong said on December 10, 2007 4:50 AM:

Hi Brad,

Congratulation on MVC released. i can't wait to write my first MVC application with it.

I have a question, Is MS MVC provide Silverlight 1.1 or 2.0 ViewEngine?

Thanks,

-Jirapong

# Wesley said on December 10, 2007 6:25 AM:

Brad,

Funny, there's not best practice and redundant code.

Not using best practice is something you might decide because it saves you some work or because you just try to make a point in an example.

Creating redundant code costs work so I don't see any reason for that.

Why not change the contents of the Top10 method to:

Top(10);

Cheers,

Wes

# BradA said on December 10, 2007 10:59 AM:

Jirapong asks if you can use MVC with Silverlight... Well you can certainly render Xaml in the view, no question.  But the app will still be a server centric application and will still round trip to the server for every interesting opperation.    That is more than OK in a number of scenarios, but I think the their are others that will require an MVC pattern for Silverlight specifically.  

# BradA said on December 10, 2007 11:01 AM:

Wesley -- you are course correct, I could have called Top(10) in the implemention of Top10() but then I could not show off different Linq syntax ;-)  

# Jeff Knutson said on December 10, 2007 11:13 AM:

Check out the ASP.NET homepage "Latest Weblogs" section for info on the new ASP.NET 3.5 Extensions CTP.

# Mike said on December 10, 2007 2:17 PM:

So why doesn't the Silverlight control need to be activated in IE? You state that it needs no javascript, does that mean that Microsoft made an exception for the Silverlight ActiveX control wrt activation? Or do you mean that the javascript is written out for us?

# ナオキにASP.NET(仮) said on December 10, 2007 8:02 PM:

昨日はイベントに出ていたためかなり遅い情報となっていますが、 ASP.NET 3.5 Extensions Preview がリリースされたようです。 ASP.NET 開発チームの方々が言及していますね。

# Christopher Steen said on December 11, 2007 1:07 AM:

Link Listing - December 10, 2007

# Christopher Steen said on December 11, 2007 1:07 AM:

Sharepoint How to: SharePoint and Microsoft Popfly working together to bring the best of Web 2.0 [Via:...

# My view of life said on December 13, 2007 7:44 AM:

DataSets DataSet enhancements in VS2008 ( link ) VS 2008 articles Weekend crash-course reading ( link

# Blogs said on December 14, 2007 10:02 PM:

We had a group of customers (and potential) customers out to campus earlier this week and I was asked

# Programming said on December 18, 2007 10:28 AM:

We had a group of customers (and potential) customers out to campus earlier this week and I was asked

# RomanB said on December 27, 2007 6:12 AM:

It is strange, but I can't find none of EnableHistory-OnNamigate stuff in ScriptManager shipped with .NET 3.5 and VS 2008.

(System.Web.Extensions.dll v3.5.21022.8).

# BradA said on December 27, 2007 10:54 PM:

RomanB - The cool new history stuff hasn't made it into the framework yet... it is in the ASP.NET Extentions preview now, and will likely get rolled into an SP sometime next year..  

# Sox said on December 31, 2007 12:27 PM:

Brad,

I think that sometimes you guys get lost in your own cleverness.

For a long time now I have found that many of the sample downloads are a complete waste of time to many who would like to learn more.

May I make several suggestions that may make things easier for your audience to digest.

1. Always link to a working sample on the web.  I want to see what your code can do BEFORE I spend my time trying to figure out the code and get it working.

2. Give basic instructions on how to load the downloaded code into your chosen web environment: VS2005; VS 2005 Express; VS2008; VS2008 Express.  Remember, if your targetted audience includes newbies, then cater for them.

3. Update your samples when the beta/ctp code is released to manufacturing.  I would like to load this into the full version of VS2008, but it is not a simple matter of creating a new VS2008 web site and copying the files. So after downloading the code, unzipping it and creating a new project, I am going to walk away...

Brad, I am not picking on you specifically, but this applies to Scot Guthrie and others in the ASP.NET Guru circuit.

You need to market to the new, the uninitiated, the unwashed, school students, PHd's, as well as the MSG's (Microsoft Geeks).

I really would like to see your stuff and check out your code.

Why else would I take the time and trouble to write to you.

If anyone else feels the same about code samples, please add your voice to this plea for simplicity.

# Chuck said on February 15, 2008 4:25 PM:

I agree with Sox - you guys are making it too difficult to use the downloads and code samples. Embedding Word 2007 readme files, not specifying the minimum requirements to run the samples, etc.

# 无常 said on February 19, 2008 11:49 AM:

在TI行业,中文的资料永远都比英文的慢几个月,而且原创性的文章也少得可怜,有空时,不妨去这些英文技术BLOG溜达溜达,也许会有意外的惊喜。

# cnblogs.com said on February 19, 2008 12:44 PM:

在IT行业,中文的资料永远都比英文的慢几个月,而且原创性的也少得可怜,有空时,不妨去这些英文技术BLOG溜达溜达,也许会有意外的惊喜。 好的C#博客应该符合这些条件: 有用的新闻、信息、技巧和代码例子

# Moe said on February 22, 2008 6:06 PM:

Why is it that when I click on any image on this page I get the exact image in an empty window? Is this the latest thing or just lazy coding? Either way, its poopie.

# Moe Again said on February 22, 2008 6:25 PM:

Just read Sox's post, I totally agree with him 100% on each point, We are pleaing for simplicity.

Chuck is right-on too. Damn, I thought I was the only one trying to drudge through the much of unnecessary code;

Are the "gurus"/AJAX'ers trying to make something that is simple in nature too complex...

Think I'll eat some lunch now, when I get back, all the world's problems better be solved... ok, ok, I'll settle for having this AJAX mess being cleaned up, Brad keep me posted on the progress of this clean-up effort, thanks.

# Philip the Duck said on February 24, 2008 7:08 PM:

I downloaded this sample a couple of days ago and now have it working nicely. When I discovered the Upload feature does nothing, I looked at the code and was fascinated to see the Upload.aspx.cs file contains a bunch of commented-out code which appears to create a job in a job queue in an "Encoder" database, via an EncoderDataContext, neither of which are included in this sample.

Is this a work in progress? Would this by any chance be related to some sort of service you're working on to take these jobs and drop them through the Expression Encoder command-line interface and publish the transcoded media files either back into this demo's Media directory or even to an online service such as Silverlight Streaming?

Curious...

# Brad Abrams said on February 25, 2008 9:49 AM:

Yes, philip, the Encoder part is still in the works... I am working with the Expression Encoder folks on an API of some kind to let you do this on the server...    I will post more when we have it more solid!

# rox19840702 said on February 27, 2008 11:28 AM:

12月16日链接篇: ASP.NET, ASP.NET AJAX, ASP.NET MVC, VS, .NET, IIS7, WPF

New Comments to this post are disabled

Search

Go

This Blog

Syndication

Page view tracker