A small but noteable design change to the ASP.NET Portal Framework

In ASP.NET V2 the new portal framework looks very interesting.  It seems to me that this framework will lend itself very nicely for building applications which allow for a plug-in style of architecture and therefore make re-use of componentize UI widgets much more prominent.

The portal framework itself is very large and I'm really only just starting to wade through it in-depth.  One interesting change that is coming through from earlier builds of ASP.NET V2 is that they are doing away with the WebPartPageMenu control.  The WebPartPageMenu control was responsible for automagically displaying a list of options for switching in and out of design mode when you want to be able to design the layout of web parts at runtime.  You can see how that was previously implemented in this code snippet:

    http://beta.asp.net/quickstart/util/srcview.aspx?path=/quickstart/aspnet/samples/webparts/intro/webparts.src

Look specifically at the following tag:

    <asp:WebPartPageMenu ID="WebPartPageMenu1" Runat="server"/>


Because this control no longer exists you need to create your own UI controls to perform that action and add code to handle the context switch.  Like so...

if(this.Button1.Text == "Design") 
{
  WebPartManager1.DisplayMode = WebPartManager.DesignDisplayMode;
  this.Button1.Text = "Exit Design Mode";
} 
else 
{
  WebPartManager1.DisplayMode = WebPartManager.BrowseDisplayMode;
  this.Button1.Text = "Design";
}

You can read about other design changes targetted for Beta 2 here:

    http://weblogs.asp.net/ShankuN/archive/2004/08/16/215487.aspx

No Comments