I have recently started to play around with umbraco and I am now trying to localize the <asp:login> tag. I have converted it to a layout template and I assign my language related strings in the following way
But when I reached the <asp:CheckBox> I steped in to a can of trouble. I can't assign the Text property of the checkbox in the same way that I do above. Am I doing this the wrong way or is there an easy solution to this? To be really clear what I want to do is replace the "Remember me next time" with my own property (in this case called rememberMe).
<asp:CheckBox runat="server" ID="RememberMe" Text='Remember the next time' />
Thanks for the quick reply! Still some problems though. I do want to convert it to a Layout template, just as you said to get rid of the table madness, and even if I don't convert it I still can't assign the RememberMeText property my own value.
What I want to do is something like this
<asp:Login runat="server" RememberMeText="<umbraco:Item field='rememberMe' textIfEmpty='Remember me next time.' runat='server'></umbraco:Item>" />
Hmm, it didn't work, just got an empty string back (Tried it by itself outside of the <asp:login> tag also and then I got the value). Maybe I am approaching this the wrong way. I think I need to read up on the documentation :)
you could use Page_Load event and set RememberMe text on the login control (You can script that functionality in your template). Be sure to set ID property on the login control, otherwise it'll fail.
localize asp:login
Hi!
I have recently started to play around with umbraco and I am now trying to localize the <asp:login> tag. I have converted it to a layout template and I assign my language related strings in the following way
But when I reached the <asp:CheckBox> I steped in to a can of trouble. I can't assign the Text property of the checkbox in the same way that I do above. Am I doing this the wrong way or is there an easy solution to this? To be really clear what I want to do is replace the "Remember me next time" with my own property (in this case called rememberMe).
Tommy,
you can use the RememberMeText property on the asp.net login control to localize the text...
In your case, you don't actually need to convert it to a Layout template... (altho it's best practice to get rid off of those table/tr/td tags)
A full overview of all props that can be set on the login control can be found here
Cheers,
/Dirk
Hi Dirk!
Thanks for the quick reply!
Still some problems though. I do want to convert it to a Layout template, just as you said to get rid of the table madness, and even if I don't convert it I still can't assign the RememberMeText property my own value.
What I want to do is something like this
But that doesn't work.
Honestly, haven't tried it that way before, but think following snippet may work:
(It doesn't solve you fallback scenario tho in case value is empty)
Cheers,
/Dirk
Hmm, it didn't work, just got an empty string back (Tried it by itself outside of the <asp:login> tag also and then I got the value).
Maybe I am approaching this the wrong way. I think I need to read up on the documentation :)
Thanks for the help Dirk!
Hi Tommy,
you could use Page_Load event and set RememberMe text on the login control (You can script that functionality in your template). Be sure to set ID property on the login control, otherwise it'll fail.
Cheers,
/Dirk
Hi Tommy,
I had the same problem and I found a solution through Page_Load
protected void Page_Load(object sender, EventArgs e) {
((Button)LoginControl.FindControl("LoginButton")).Text = umbraco.library.GetDictionaryItem("loginLoginButtonText");
..........
<asp:Login ID="LoginControl".........
<LayoutTemplate>..........
<asp:Button ID="LoginButton" ..........
is working on a reply...