开发者

Localization in button MVC2

开发者 https://www.devze.com 2023-02-10 02:24 出处:网络
I am trying to create an mvc2 application i need to apply localization localization applied to labels works fine.

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" />

0

精彩评论

暂无评论...
验证码 换一张
取 消