For years, I've been teaching an ASP.NET class where we build an ASP.NET website in Visual Studion 2008 and use it to do hands-on training exercises. However, I've never looked at perform these exercises in a web application to see what the difference is - assuming that it would be the same. I learned over the weekend that it is not; one of the differences being direct access to the Profile object in your WebForm, which you can't get to from within a web application build like you can from a website build.

Of course, there are serious ways to get to it - none of which seem to be that different. One way is to create a wrapper class that you can use to get to your Profile information. Joe Wrobel has an excellent one that you can install and use in your web applications that is available here:

http://code.msdn.microsoft.com/WebProfileBuilder (downloads) 

http://weblogs.asp.net/joewrobel/archive/2008/02/03/web-profile-builder-for-web-application-projects.aspx (blog post)

However, a friend I was helping with this still had questions on how exactly to use it after installing the build task and updating the project file, which is where the directions are a little unclear. The next is to implement this property for each of your webforms you intend to use the new WebProfile object:

private WebProfile Profile
{
     get { return new WebProfile(Context.Profile); }

My friend was able to convert her web application thanks to this code. Now I need to go find out what else is different about website and web applications in preparation for my next class.

Cool 

June 1, 2009 13:40 by RafaelV
E-mail | Permalink | Comments (0) | Comment RSSRSS comment feed