I am trying to create an mvc2 application
i need to apply localization
localization applied to labels works fine.
but i don't know how a开发者_如何学编程pply localization in button value.
my code is:
<input type="submit" value="<%: MVC.App_GlobalResources.Button.LogOn_Submit %>" class="login_button_75" />
please help me
thanks
suraj
I made it correct by the following code It works cool...
<input type="submit" value="<%: GetGlobalResourceObject("Button","LogOn_Submit") %>" class="login_button_75" />
suraj
Here is a great post on how to implement localization in asp.net mvc 2. What you need to write in order to access the string inside your resource is the following:
Given that the Resource Namespace is MyResourceNamespace
and the Resource name is MyPageResource
and the Name of the resource object you want to use is Login_Submit
you can write:
<% MyREsourceNamespace.MyPageResource.Login_Submit %>
And to apply this to your value you can write:
<input type="submit" value="<%: MyREsourceNamespace.MyPageResource.Login_Submit %>" class="login_button_75" />
精彩评论