Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set button text using resource file

I have created resource file under Test Project but not under App_GlobalResources.How can i set button text using resource file. For eg:

<asp:Button ID="btnTest" runat="server" Text="<%:TestProject.TestResource.Test%>" />

When i use above code i am getting blank text in the button.

Note - I don't want to set text at code behind.How can i achieve this at aspx file.

Thanks for the help

like image 308
Beginner Avatar asked Oct 31 '12 05:10

Beginner


1 Answers

Assuming your Resourcesfile is called:

/App_GlobalResources/TestResource.resx

And the resource string Test, this should work:

<asp:Button ID="btnTest" runat="server" Text="<%$ Resources: TestResource, Test %>" />
like image 115
Remy Avatar answered Sep 24 '22 16:09

Remy