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.
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
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
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
Hi Dennis,
http://forums.asp.net/t/969928.aspx/1 have a look at this :). The is what you need. CultureInfo.
Charlie :)
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
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)
is working on a reply...