Copied to clipboard

Flag this post as spam?

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


  • Kim Grandgagnage 63 posts 87 karma points
    Jun 16, 2011 @ 11:22
    Kim Grandgagnage
    0

    how to pass the value of a dictionary item within asp:Login control

    I would like to set he UserNameLabelText property and the PasswordLabelText property of the asp:Login control to the value of a dictionary item. How can I do this?

     

  • Karl Campeau 12 posts 34 karma points
    Jul 29, 2011 @ 21:11
    Karl Campeau
    0

    I've found two options:
    You can utilize <LayoutTemplate> within the asp:Login login control as described in the following link: http://our.umbraco.org/forum/developers/api-questions/6651-Multilingual-LoginView-control

    OR

    Here is an example where I wrote code in a template to update a property within within the asp:LoginStatus control:

    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {  
          LoginStatus LoginStatusControl = (LoginStatus)LoginView1.FindControl("LoginStatus1");
          LoginStatusControl.LoginText = umbraco.library.GetDictionaryItem("Login");
        }
    </script>

    <asp:LoginView id="LoginView1" runat="server">
                  <AnonymousTemplate>
                    <li><asp:LoginStatus id="LoginStatus1" runat="server"></asp:LoginStatus></li>
                    <li><a href="/Register.aspx"><umbraco:Item field="#Register" runat="server"></umbraco:Item></a></li>
                  </AnonymousTemplate>
                  <LoggedInTemplate>
                    <li>Thanks for logging in <asp:LoginName id="LoginName1" runat="Server"></asp:LoginName></li>
                    <li><a href="/UpdateProfile.aspx">Update Profile</a></li>
                    <li><asp:LoginStatus id="LoginStatus1" runat="server"></asp:LoginStatus></li>
                  </LoggedInTemplate>
              </asp:LoginView>

Please Sign in or register to post replies

Write your reply to:

Draft