<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Web Parts and Personalization</title><link>http://forums.asp.net/145.aspx</link><description>Discussions of the new ASP.NET 2.0 portal framework.  &lt;a href="http://aspadvice.com/SignUp/list.aspx?l=167&amp;c=30" target="_blank"&gt;Email List&lt;/a&gt;</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Re: Unable to change WebPartDisplayMode when WebForm uses Master Page</title><link>http://forums.asp.net/thread/401651.aspx</link><pubDate>Sun, 23 Nov 2003 09:34:04 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:401651</guid><dc:creator>Fredrik N</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/401651.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=145&amp;PostID=401651</wfw:commentRss><description>Here is a code that works fine. I have a WebPartZone in a content control. Is your code similar to this?
&lt;br /&gt;
&lt;pre&gt;
&lt;br /&gt;
&amp;lt;%@ page language=&amp;quot;C#&amp;quot; master=&amp;quot;~/default.master&amp;quot;%&amp;gt;
&lt;br /&gt;
&amp;lt;%@ register tagprefix=&amp;quot;uc1&amp;quot; tagname=&amp;quot;myControl&amp;quot; src=&amp;quot;~/myControl.ascx&amp;quot; %&amp;gt;
&lt;br /&gt;

&lt;br /&gt;
&amp;lt;script runat=&amp;quot;server&amp;quot;&amp;gt;
&lt;br /&gt;

&lt;br /&gt;
    void edit(object s, EventArgs e)
&lt;br /&gt;
    {
&lt;br /&gt;
        WebPartManager.Current.SetDisplayMode(WebPartDisplayMode.Design);
&lt;br /&gt;
    }
&lt;br /&gt;
    
&lt;br /&gt;
&amp;lt;/script&amp;gt;
&lt;br /&gt;

&lt;br /&gt;
&amp;lt;asp:content contentplaceholderid=&amp;quot;content&amp;quot; runat=&amp;quot;Server&amp;quot;&amp;gt;
&lt;br /&gt;
        
&lt;br /&gt;
        
&lt;br /&gt;
        &amp;lt;asp:webpartmanager id=&amp;quot;WebPartManager1&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;&amp;lt;/asp:webpartmanager&amp;gt;
&lt;br /&gt;
        
&lt;br /&gt;
        &amp;lt;asp:linkbutton onclick=&amp;quot;edit&amp;quot; runat=&amp;quot;Server&amp;quot;&amp;gt;Edit&amp;lt;/asp:linkbutton&amp;gt;&amp;lt;br /&amp;gt;
&lt;br /&gt;
        
&lt;br /&gt;
        &amp;lt;asp:webpartzone id=&amp;quot;WebPartZone1&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;
&lt;br /&gt;
            &amp;lt;zonetemplate&amp;gt;
&lt;br /&gt;
                &amp;lt;asp:contentwebpart id=&amp;quot;ContentWebPart1&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;
&lt;br /&gt;
                &amp;lt;contenttemplate&amp;gt;
&lt;br /&gt;
                    Test....
&lt;br /&gt;
                &amp;lt;/contenttemplate&amp;gt;
&lt;br /&gt;
                &amp;lt;/asp:contentwebpart&amp;gt;
&lt;br /&gt;
            &amp;lt;/zonetemplate&amp;gt;
&lt;br /&gt;
        &amp;lt;/asp:webpartzone&amp;gt;
&lt;br /&gt;
        &amp;lt;asp:webpartzone id=&amp;quot;WebPartZone2&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;
&lt;br /&gt;
            &amp;lt;zonetemplate&amp;gt;
&lt;br /&gt;
                  &amp;lt;uc1:mycontrol id=&amp;quot;MyControl1&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;&amp;lt;/uc1:mycontrol&amp;gt;
&lt;br /&gt;
            &amp;lt;/zonetemplate&amp;gt;
&lt;br /&gt;
        &amp;lt;/asp:webpartzone&amp;gt;
&lt;br /&gt;
&amp;lt;/asp:content&amp;gt;
&lt;br /&gt;
&lt;/pre&gt;
&lt;br /&gt;
This is something that doesn’t belong to your question and maybe you already knew this: You can create nested master pages, so you can create a main master page that two other master pages inherit. In this way you can create two sub master pages, one that has web part support and one that doesn’t. Like you I have also built a demonstration site that should have pages that doesn’t use web parts and some pages that will use web parts. The purpose is to demonstrate all the new features, including nested master pages.</description></item><item><title>Re: Unable to change WebPartDisplayMode when WebForm uses Master Page</title><link>http://forums.asp.net/thread/401638.aspx</link><pubDate>Sun, 23 Nov 2003 08:53:19 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:401638</guid><dc:creator>guam-aspdev</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/401638.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=145&amp;PostID=401638</wfw:commentRss><description>Good idea.  I considered that, but I only need WebParts in some of my pages, and my Master Page layouts are more universal.  I'll keep that in mind.</description></item><item><title>Re: Unable to change WebPartDisplayMode when WebForm uses Master Page</title><link>http://forums.asp.net/thread/401635.aspx</link><pubDate>Sun, 23 Nov 2003 08:40:26 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:401635</guid><dc:creator>Fredrik N</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/401635.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=145&amp;PostID=401635</wfw:commentRss><description>It works fine for me. 
&lt;br /&gt;

&lt;br /&gt;
I also have some small problem from the beginning. Here is what I have done to make it work; 
&lt;br /&gt;

&lt;br /&gt;
I’ve added the WebPartManager into the MasterPage it self. 
&lt;br /&gt;
I also put the code that changes the mode of the WebPartManager into the MasterPage:
&lt;br /&gt;

&lt;br /&gt;
&lt;pre&gt;
&lt;br /&gt;
WebPartManager.Current.SetDisplayMode(WebPartDisplayMode.Edit);
&lt;br /&gt;
&lt;/pre&gt;
&lt;br /&gt;

&lt;br /&gt;
&amp;lt;asp:linkbutton runat=&amp;quot;Server&amp;quot; id=&amp;quot;perzonalizeWorkspace&amp;quot; onclick=&amp;quot;personalize_Click&amp;quot;&amp;gt;Personalize this page&amp;lt;/asp:linkbutton&amp;gt;
&lt;br /&gt;

&lt;br /&gt;

&lt;br /&gt;
void personalize_Click(object sender, System.EventArgs e)
&lt;br /&gt;
{
&lt;br /&gt;
WebPartManager.Current.SetDisplayMode(WebPartDisplayMode.Edit);
&lt;br /&gt;
}
&lt;br /&gt;

&lt;br /&gt;
Maybe you wonder why I put it into the MasterPage. It’s because I will use WebParts in all of my pages and it’s a good place to add it.
&lt;br /&gt;

&lt;br /&gt;</description></item><item><title>Re: Unable to change WebPartDisplayMode when WebForm uses Master Page</title><link>http://forums.asp.net/thread/401514.aspx</link><pubDate>Sun, 23 Nov 2003 00:34:15 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:401514</guid><dc:creator>guam-aspdev</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/401514.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=145&amp;PostID=401514</wfw:commentRss><description>Check that...I was able to get the WebParts to get into Design mode, but only by setting the WebPartsDisplayMode enumeration to &amp;quot;Display&amp;quot; in Page_Load.  It's probably something with my code, but if anyone has run into this problem, please chime in.
&lt;br /&gt;

&lt;br /&gt;
Jas
&lt;br /&gt;</description></item><item><title>Unable to change WebPartDisplayMode when WebForm uses Master Page</title><link>http://forums.asp.net/thread/401313.aspx</link><pubDate>Sat, 22 Nov 2003 14:25:55 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:401313</guid><dc:creator>guam-aspdev</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/401313.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=145&amp;PostID=401313</wfw:commentRss><description>Hi everyone,
&lt;br /&gt;

&lt;br /&gt;
I’ve run into a little snag…I’m hoping it might just be an alpha thing.  I’ve been trying to do an integrated example for an article on developing WebParts I’m working on, so I wanted to combine several Whidbey technologies at the same time, to demonstrate 2.0’s ease of migration and also to show how easy it is to actually build and manage something quickly.
&lt;br /&gt;

&lt;br /&gt;
I’m for some reason unable to modify the WebPartDisplayMode of a page when a .ASPX page is using a Master Page.  I wrote the code for it, but it won’t seem to take, and on post back, just says in the default Normal mode, instead of going into Design mode or one of the other choices from the WebPartDisplayMode enumeration.
&lt;br /&gt;

&lt;br /&gt;
Here's scenario: I've got a series of user controls contained in a number of WebParts in a Content control on a WebForm.  The page has a main header, footer and navigation bar on the left, all 3 of which are served from a Master page to define layout.  Without the Content control, it works perfectly, allowing me to toggle between Normal and Design modes.  But when I apply the Master Page, it won't change on post back.
&lt;br /&gt;

&lt;br /&gt;

&lt;br /&gt;
Anyone else run into this?
&lt;br /&gt;

&lt;br /&gt;
Jas 
&lt;br /&gt;

&lt;br /&gt;

&lt;br /&gt;</description></item></channel></rss>