Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • saif 68 posts 88 karma points
    Mar 06, 2012 @ 12:00
    saif
    0

    Hi All,

    I created three contentplaceholder in a master page.

    Whatever  is in the header contentplaceholder it supposed to be displayed at top of the sub pages but it does not.

    Please could you tell me what I am doing wrong.

    Thanks in adv.

  • Anthony Dang 1404 posts 2558 karma points MVP 3x c-trib
    Mar 06, 2012 @ 13:02
    Anthony Dang
    0

    Can you paste your markup here?

     

  • saif 68 posts 88 karma points
    Mar 06, 2012 @ 13:06
    saif
    0

    Hi Anthony,

    here is markup. I tried to follow CWS site by Warren Buckley


    <asp:Content ContentPlaceHolderID="ContentPlaceHolderDefault" runat="server">
        <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd">
        <html xmlns="http://www.w3.org/1999/xhtml">
        <head>
            <title><umbraco:Item Field="siteName" runat="server" /></title>
            <!-- CSS -->
            <link href="/CSS/Reset.css" rel="stylesheet" type="text/css" />
            <link href="/CSS/Styles.css" rel="stylesheet" type="text/css" />

            <!-- JS -->
            <script src="../scripts/jquery-1.7.1.min.js" type="text/javascript"></script>
            <!-- Meta Data -->
            <meta name="description" content="<umbraco:Item field='metaDescription' recursive='true' runat='server' />" />
            <meta name="keywords" content="<umbraco:Item field='metaKeywords' runat='server' />" />
        </head>
        <body>
            <div id="container">
             <!-- HEADER -->
              <div id="header">
                <div class="container clearfix">
                    <h1 class="flashHeader left">
                        <a href="/" title="&laquo; Back to Your Company Name">
                           <umbraco:Item field="siteName" runat="server" />
                        </a>
                    </h1>
                    <div class="right headerLinks">                   
                           <asp:contentplaceholder id="headerLinksContent" runat="server">
                          <form id="Form1"  runat="server">
                                        <asp:loginview id="LoginView1" runat="server">
                                <AnonymousTemplate>
                                 Please Login:
                                       </AnonymousTemplate>      
                                <LoggedInTemplate>
                                      Welcome:<asp:LoginName id="LoginName1" runat="server"></asp:LoginName>
                                       </LoggedInTemplate>         
                                </asp:loginview>
                                        <asp:loginstatus id="LoginStatus1" runat="server"></asp:loginstatus>
                            </form>
                            </asp:contentplaceholder>
                       
                        <!-- Search box -->
                        <div class="right searchBox">
                            <input type="text" />
                            <button>Search</button>
                        </div>
                    </div>
                </div>           
            </div>

     

             
                <!-- BODY-->
                <div id="body">
                    <div class="clearfix">
                        <div id="sideBar" class="left">
                            <umbraco:Macro Alias="HSNavigation" runat="server" />
                            <asp:contentplaceholder id="sideBarContent" runat="server">
                            </asp:contentplaceholder>
                        </div>
                        <asp:contentplaceholder id="childContent" runat="server">
                        </asp:contentplaceholder>
                    </div>
                </div>
                <!-- FOOTER -->
                <div id="footer">
                </div>
            </div>
            <%--Container--%>
        </body>
        </html>
    </asp:Content>

  • Anthony Dang 1404 posts 2558 karma points MVP 3x c-trib
    Mar 06, 2012 @ 13:15
    Anthony Dang
    0

    Replace this chunk

      <asp:contentplaceholder id="headerLinksContent" runat="server">
                          <form id="Form1"  runat="server">
                                        <asp:loginview id="LoginView1" runat="server">
                                <AnonymousTemplate>
                                 Please Login:
                                       </AnonymousTemplate>      
                                <LoggedInTemplate>
                                      Welcome:<asp:LoginName id="LoginName1" runat="server"></asp:LoginName>
                                       </LoggedInTemplate>          
                                </asp:loginview>
                                        <asp:loginstatus id="LoginStatus1" runat="server"></asp:loginstatus>
                            </form>
                            </asp:contentplaceholder>

     

    with

     

      <asp:contentplaceholder id="headerLinksContent" runat="server" />
                          
        <form id="Form1"  runat="server">
           <asp:loginview id="LoginView1" runat="server">
                    <AnonymousTemplate>
                        Please Login:
                     </AnonymousTemplate>      
                      <LoggedInTemplate>
                              Welcome:<asp:LoginName id="LoginName1" runat="server"></asp:LoginName>
                       </LoggedInTemplate>          
              </asp:loginview>
               <asp:loginstatus id="LoginStatus1" runat="server"></asp:loginstatus>
      </form>  

     

     

     

  • saif 68 posts 88 karma points
    Mar 06, 2012 @ 13:37
    saif
    0

    Hi Anthony,

    The reason I put login control in contentplace holder it was throwing an error as below.

    Control 'ctl00_ctl00_ctl00_ContentPlaceHolderDefault_LoginStatus1' of type 'LoginStatus' must be placed inside a form tag with runat=server

    Please could you suggest any other alternative to put the login control in header of master page.

    regards

     

  • Anthony Dang 1404 posts 2558 karma points MVP 3x c-trib
    Mar 06, 2012 @ 13:48
    Anthony Dang
    0

    Oops. I didnt notice the form.

    Put the form on the outside.

     


     <form id="Form1"  runat="server">
     <asp:contentplaceholder id="headerLinksContent" runat="server" />
           <asp:loginview id="LoginView1" runat="server">
                    <AnonymousTemplate>
                        Please Login:
                     </AnonymousTemplate>      
                      <LoggedInTemplate>
                              Welcome:<asp:LoginName id="LoginName1" runat="server"></asp:LoginName>
                       </LoggedInTemplate>          
              </asp:loginview>
               <asp:loginstatus id="LoginStatus1" runat="server"></asp:loginstatus>
      </form>

     

     

  • saif 68 posts 88 karma points
    Mar 06, 2012 @ 15:08
    saif
    0

    Actually form tag does not work itself unless I put this into a content place holder.

Please Sign in or register to post replies

Write your reply to:

Draft