>
 Monday, September 12, 2005

We put on a 1 day seminar at UCSD Extension on Saturday for those interested in getting up to speed on the upcoming release of .NET 2.0. I'm posting a bunch of 2.0 samples here directly related to the topics we covered at the event.

Dave McCarter gave a great overview of the VS 2005 IDE and its productivity features. No code to share on that one, you have to be there to see it!

I presented a talk on VB.NET and C# language enhancements. Samples include a few new VB.NET samples:

Several C# samples that are posted on the IDesign site:

 

I also presented a talk on ClickOnce and Smart Clients...the code sample is better seen in “live demo“ but here's the finished product of what I demonstrated:

And to wrap things up, Scott Mitchell gave a great talk on ASP.NET 2.0...he did most of his demos live, but I told him I'd post some of my finished ASP.NET 2.0 samples here that were related to his talk...since I have them handy:

aspnet20samples.zip 

 

 

For more IDesign samples go here:

http://www.idesign.net/idesign/DesktopDefault.aspx?tabindex=5&tabid=8

 

Enjoy!

 

 Monday, August 22, 2005

If you haven't tried this already, I have definitely saved you at least one hour, for the two I spent playing, toying, testing, and writing this little blog. The issue is when you want to combine formatting statements with binding activity. Of course the trusty Eval() function will allow us to provide a format statement:

<asp:Image id=Image2 width=200 height=200 BorderWidth=2 runat="server" ImageUrl='<%# Eval("url", "~/Photos/{0}") %>' ></asp:Image>

But what if I don't want to hard-code the path? What if I want to use AppSettings, for example? It really isn't so difficult, but it required a little playing around before I realized that I can literally use the binding statement for any code output, including the String.Format...and, within the context of the binding statement <%# ... %> I can use Container.DataItem to get at row values. This example pulls together AppSettings with row values to build the ImageUrl property:

<asp:Image id=Image2 width=200 height=200 BorderWidth=2 runat="server" ImageUrl='<%# String.Format("{0}{1}", System.Configuration.ConfigurationManager.AppSettings["PhotosDir"], ((System.Data.DataRowView)Container.DataItem)["url"])%>' ></asp:Image>

 

8/22/2005 9:15 PM ADO.NET | ASP.NET | ASP.NET 2.0 Migration  | Comments [5]  |  View reactions  |  Trackback

Sure, the syntax got easier. Instead of the cumbersome:

<%# DataBinder.Eval(Container.DataItem, "url") %>

We get to save some strokes and remove the entire confusion around “what the heck is Container.DataItem?“:

<%# Eval("url") %>

But, this isn't all its cracked up to be. Eval() STILL uses reflection to evaluate expressions, therefore for every bound column/row displayed in your ASP.NET pages, you are adding overhead, unnecessarily. Of course, what this really means is, just like with 1.1, you should be using explicit casts to cast Container.DataItem to its actual type:

<%# ((System.Data.DataRowView)Container.DataItem)["url"]) %>

Of course the trick is to know...you guessed it...what the heck is Container.DataItem??? A quick way to find this out for various objects you may choose to employ in binding, is to bind just to Container.DataItem as a test. In the attached example I bound the GridView control to the Web configuration sections:

Configuration webConfig = System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration(Request.ApplicationPath);

ConfigurationSectionCollection webConfigSections = webConfig.Sections;

GridView1.DataSource = webConfigSections;

In the GridView declaration I included these labels in a template column:

<asp:Label ID="Label2" runat="server" Text='<%# Container.DataItem%>'></asp:Label>:

<asp:Label ID="Label3" runat="server" Text='<%# ((ConfigurationSection)Container.DataItem).SectionInformation.SectionName %>'></asp:Label>

Now you can consider yourself early bound.

ConfigurationUtility.zip (60.58 KB)
8/22/2005 9:03 PM ADO.NET | ASP.NET | ASP.NET 2.0 Migration  | Comments [20]  |  View reactions  |  Trackback
 Saturday, August 20, 2005

Hi folks...I have finally uploaded my super duper ASP.NET sample code:

http://www.dasblonde.net/ct.ashx?id=f8b330d8-0a87-496c-8be3-3aff101bfd58&url=http%3a%2f%2fwww.dasblonde.net%2fcontent%2fbinary%2fGalleryDemo20.zip

It includes features like:

  • Master pages
  • Security controls and membership
  • New localization features and a localized database
  • Use of Profile to track culture and theme preferences (there are some tricks in here)
  • Use of new GridView and DetailsView controls, with ObjectDataSource (decoupling presentation from data)

This upload is related to my previous blog post here, in case you were waiting for the code...yikes I have been busy! http://www.dasblonde.net/PermaLink.aspx?guid=f8b330d8-0a87-496c-8be3-3aff101bfd58

Don't forget to read the instructions for setup!

 

 

 

8/20/2005 3:42 PM ASP.NET | ASP.NET 2.0 Migration  | Comments [2]  |  View reactions  |  Trackback
 Saturday, June 11, 2005

In this talk I took an application that was built for 1.1, with migration in mind. And demonstrated its migration to 2.0. The “before” sample can be found in this blog post:

http://www.dasblonde.net/PermaLink.aspx?guid=9a3d226f-91a0-461f-af97-530488b0f7e2

 

 

The “after” sample with a 2.0 version of the same application, can be found here:

GalleryDemo20.zip (1.88 MB)

 

Other resources:

         My MSDN Whidbey Articles

        http://msdn.microsoft.com/asp.net/community/authors/mlb/default.aspx

         ASP.NET Whidbey Team Resources & Book

        http://www.asp.net/whidbey

         ASP.NET Forum

        http://www.asp.net/forums

 

This API has been recently updated and posted here:

http://www.asp.net/memberroles/memberroles.htm

 

You’ll notice that the license has been updated to be slightly less restrictive from the original post. Now you can continue using the 1.1 API on production for 3 months after the release of ASP.NET 2.0, which we expect to be later this year. This is still somewhate limiting, because it presumes you have a go-live plan so soon after the release that you may as well be going live today with Beta 2. I’m not sure if the license will change again, so I encourage you to read the license in the download, when you download it…to confirm my statements are still accurate. For what it is worth, my sample code will demonstrate how to put it to use with 1.1.

6/11/2005 7:10 PM ASP.NET | ASP.NET 2.0 Migration  | Comments [3]  |  View reactions  |  Trackback
 Sunday, May 01, 2005

No, please, make it stop, don't make me go back, I don't want to go back...I'll never go back...ok, fine, I'll go back...for now...but I won't like it...

Well, if you haven't stated these words, or thought them, or something like them, you will...believe me. Once you get your hands on ASP.NET Beta 2, it is next to impossible to look at 1.1 again without holding back tears of pain. It's like buying a killer new outfit...you want to wear it right away, not hang it in the closet for later! Yeah, you know what I mean.

Unfortunately, there are plenty of companies out there that are not ready to embrace Beta 2 as their current development platform for new applications. Nor are they prepared to migrate all 1.1 applications just because 2.0 is cool. It's called a business decision...companies don't make money by converting code to new platforms just because. Migration and platform upgrades require planning.

So, the question is, how can ASP.NET developers lessen the pain of returning to 1.1, and better prepare to migrate their code to 2.0? Well I just happen to be updating one of my migration speeches these next few weeks, in preparation for the SDC conference I present at each May in The Netherlands. So, I'll be posting some blogs on the subject, based on the following core topics:

  • Master Pages
  • Navigation Controls
  • Data Controls and Binding
  • Security Controls and Membership API
  • Configuration
  • Caching
  • Localization
  • Personalization
  • Deployment

Have any other hot points to add to the list? Let me know! Otherwise, watch for the migration blogs forthcoming...

5/1/2005 8:16 PM ASP.NET 2.0 Migration  | Comments [3]  |  View reactions  |  Trackback
    ON THIS PAGE
    SEARCH
    CATEGORIES
    ARCHIVES
    BLOGROLL

Designed by NUKEATION STUDIOS