i have an asp.net webpage, which contains a label, now i want to get the text property of the label from the localresource file, i have a .resx
file under
First you need to create appropriate structure inside web project. In this case I will be using Default.aspx:
Take notice I have placed Default.aspx.resx file inside App_LocalResources.
Next enter new item inside Default.aspx.resx like this:
The important thing is you need to set Text property (UserNameLabel.Text)
And finally here is aspx code:
<asp:Label ID="UserNameLabel" runat="server" meta:resourcekey="UserNameLabel"></asp:Label>
I have used meta:resourcekey to link to appropriate resource key.