Copied to clipboard

Flag this post as spam?

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


  • Dennis Aaen 4500 posts 18255 karma points admin hq c-trib
    Feb 07, 2013 @ 19:55
    Dennis Aaen
    0

    How do I change the language on FailureText on asp login form

    Hi,

    I have a problem, with a login form.

    I have a login page on my site, and the error text is on english, but I want to change it to danish.

    On my localhost, I just set the hostname to http://xx.localhost and the language to danish at the manage hostnames, but when I do the same thing on the live site, it has no effect, the FailureText is still on english.

    My login template looks like this.

     <div id="loginPage">
            <form runat="server">
            <asp:login id="Login1" runat="server">
                      <LayoutTemplate>
                        <div id="loginbox">
                          <span class="error">
                            <asp:Literal id="FailureText" runat="server"></asp:Literal>
                          </span>
                          <div class="leftSide">
                            <label class="first" for="ContentPlaceHolderDefault_Content_Login1_UserName">Brugernavn:   </label><br/>
                            <asp:TextBox CssClass="second text" id="UserName" runat="server"></asp:TextBox>
                          </div>
                          <div class="rightSide">
                            <label class="first" for="ContentPlaceHolderDefault_Content_Login1_Password">Kodeord:</label><br/>
                            <asp:TextBox CssClass="second text" id="Password" runat="server" textMode="Password"></asp:TextBox>
                          </div>
                          <!--<asp:Checkbox id="RememberMe" runat="server" Text="Husk mit login"></asp:Checkbox><br/>-->
                          <div id="loginButtonContainer">
                            <asp:button CssClass="btnSubmit" id="Login" CommandName="Login" runat="server" Text="Log ind"></asp:button>
                          </div>
                        </div>
                      </LayoutTemplate>
                  </asp:login>
            </form>
        </div>

    I hope someone out there can help me to figure it out.

    I´m using Umbraco version 4.11.1 (Assembly version: 1.0.4715.27659)

    /Dennis

  • Dennis Aaen 4500 posts 18255 karma points admin hq c-trib
    Feb 07, 2013 @ 20:44
    Dennis Aaen
    100

    I manage to find a solution myself.

    The solution was to add attribute FailureText on the <asp:login> tag.

    So my code look like this now.

        <div id="loginPage">
            <form runat="server">
            <asp:login id="Login1" runat="server" FailureText="Du har indtastet et forkert brugernavn eller en forkert adgangskode.">
                      <LayoutTemplate>
                        <div id="loginbox">
                          <span class="error">
                            <asp:Literal id="FailureText" runat="server"></asp:Literal>
                          </span>
                          <div class="leftSide">
                            <label class="first" for="ContentPlaceHolderDefault_Content_Login1_UserName">Brugernavn:</label><br/>
                            <asp:TextBox CssClass="second text" id="UserName" runat="server"></asp:TextBox>
                          </div>
                          <div class="rightSide">
                            <label class="first" for="ContentPlaceHolderDefault_Content_Login1_Password">Kodeord:</label><br/>
                            <asp:TextBox CssClass="second text" id="Password" runat="server" textMode="Password"></asp:TextBox>
                          </div>
                          <!--<asp:Checkbox id="RememberMe" runat="server" Text="Husk mit login"></asp:Checkbox><br/>-->
                          <div id="loginButtonContainer">
                            <asp:button CssClass="btnSubmit" id="Login" CommandName="Login" runat="server" Text="Log ind"></asp:button>
                          </div>
                        </div>
                      </LayoutTemplate>
                  </asp:login>
            </form>
        </div>

    /Dennis

  • Charles Afford 1163 posts 1709 karma points
    Feb 10, 2013 @ 19:41
    Charles Afford
    0

    Hi Dennis,

    http://forums.asp.net/t/969928.aspx/1 have a look at this :).  The is what you need.  CultureInfo.

    Charlie :)

  • Dennis Aaen 4500 posts 18255 karma points admin hq c-trib
    Feb 11, 2013 @ 10:13
    Dennis Aaen
    0

    Hi Charlie,

    Thanks for your input.

    Is a small website in dansih, and only that language so for the case, there is no problem, that the string,can be hard coded.

    I know that it is not best practice to do it that way, and maybe I consider to change it in to a dictionary item, in time.

    /Dennis

  • Charles Afford 1163 posts 1709 karma points
    May 13, 2013 @ 21:45
    Charles Afford
    0

    No problem :) sorry i could not be more helpfull.  May be this would be usefull for you in the future :).  It was just posted by another member on the boards.  http://pastebin.com/7gJ34M8x

    Idictonary (multi language solutions)

Please Sign in or register to post replies

Write your reply to:

Draft