Search code examples
asp.netvisual-studio-expressvisual-web-developer

Visual Web Developer - Child page preview with Login View on Master Page


I have the following problem:

I run Visual Web Developer 2008. I have one Master Page and few child pages. On the Master Page I have Login View control, as below:

    <asp:LoginView ID="LoginView1" runat="server">

         <LoggedInTemplate>
             <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
            </asp:ContentPlaceHolder>
        </LoggedInTemplate>

        <AnonymousTemplate>
            <asp:Login ID="Login1" runat="server" BackColor="White" Font-Size="Small">
            </asp:Login>             
        </AnonymousTemplate>

    </asp:LoginView>

When I work on one of child pages and I switch to Design view I see only Master Page with the Login Box (only AnonymousTemplate). I cannot change the mode of Login View to "LoggedInTemplate" because all Master Page elements are disabled in child page Design mode. Bug or feature? How can I preview Design for my child page?


Solution

  • Unfortunately, this appears to be by design. If you must use the Design view, you will have to temporarily move the ContentPlaceHolder outside of the LoginView.

    In all honesty though, I have never trusted the Design view - it never shows the page exactly like it appears in a given browser (even Internet Explorer). I prefer using "View in Browser" to see what my page looks like.