Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Insert resource into submit value

I want to localize Submit button in ASP.NET MVC application but don't know how to inerpolate it into value attribute.

<input type="submit" value="Resources.Global.Create" />

It prints Resources.Global.Create on form, but it should print localized value not variable name.

like image 945
Иван Бишевац Avatar asked Mar 19 '26 07:03

Иван Бишевац


1 Answers

You're missing the magic Razor character (@):

<input type="submit" value="@Resources.Global.Create" />
like image 142
Cristian Lupascu Avatar answered Mar 20 '26 20:03

Cristian Lupascu



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!