The Artima Developer Community
Sponsored Link

.NET Buzz Forum
WebPartPageMenu control is not in Beta2?!?

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Sean McCormack

Posts: 504
Nickname: adapdev
Registered: Jan, 2005

Sean McCormack is the Lead .NET Architect for Miller Brewing Co. and founder of Adapdev Technologies
WebPartPageMenu control is not in Beta2?!? Posted: Jun 1, 2005 4:05 PM
Reply to this message Reply

This post originated from an RSS feed registered with .NET Buzz by Sean McCormack.
Original Post: WebPartPageMenu control is not in Beta2?!?
Feed Title: Vini Vidi Vici - Sean McCormack's Blog
Feed URL: http://smccormack.blogs.com/adapdev/SyndicationService.asmx/GetRss
Feed Description: Sean McCormack's Blog, focusing on various aspects of .NET development, open source projects, recommended books and tools
Latest .NET Buzz Posts
Latest .NET Buzz Posts by Sean McCormack
Latest Posts From Vini Vidi Vici - Sean McCormack's Blog

Advertisement

I've been playing with the Beta2, going through ASP.NET 2.0 - The Beta Version when I came across a great sample on WebParts.  Unfortunately, I hit a small snag though when trying the following code:

<asp:WebPartPageMenu ID="WebPartPageMenu1" Runat="server"
     MenuStyle-BorderColor="#000000" MenuStyle-BorderStyle="Solid"
     MenuStyle-BorderWidth="1" />

The WebPartPageMenu control provides a nice dropdown list of functions, such as browsing the catalog of WebParts, changing layouts, etc.  Here's an example:

Turns out, WebPartPageMenu is no longer in Beta2!!  You now have to do something like this:

using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class _Default : System.Web.UI.Page
{
  protected void Page_Load(object sender, EventArgs e)
  {
    this.WebPartManager1.DisplayMode = WebPartManager.CatalogDisplayMode;
  }
}

The WebPartManager class provides several options, such as EditDisplayMode, BrowseDisplayMode, etc.  Not pretty.  Looks like you essentially have to write from scratch what used to be available with the WebPartPageMenu??  Does anyone know if there are plans for a replacement or similar control in the final release??

Here's the Beta2 change information:

WebPartPageMenu Control

This control provided a convenient mechanism for switching page personalization modes in pages using the web parts control set. The UI generated by this control is a dropdown list or menu similar to Sharepoint. However, pages often require more flexibility for switching modes than this control provides, and the WebPartManager class makes it easy to programmatically switch personalization mode from any server control.

To switch modes, you can use an interactive server control such as a Button, LinkButton, or DropDownList, and write an event handler for it that programmatically switches the personalization mode. For example, the following code will switch the personalization mode of a WebPartManager:  

WebPartManager1.DisplayMode = WebPartManager.DesignDisplayMode

Read: WebPartPageMenu control is not in Beta2?!?

Topic: [INETA] Ist die Gruppe neu? Nein, mit AJAX gewaschen ... Nein, wie war es nochmal? Previous Topic   Next Topic Topic: Not Dead

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use