我已經localizaed ASP.NET MVC應用程序與觀點:ASP.NET MVC提交按鈕定位
<button type="submit" value="@Resources.Yes">
<button type="submit" value="@Resources.No">
和cotroller:
public ActionResult Index(..., string submit)
{
switch (submit)
{
case "Yes":
default:
.....
break;
case "No":
....
break;
}
}
但它的工作原理很明顯只爲英語。你如何解決多種語言的提交按鈕檢測?
我發現文章http://blog.maartenballiauw.be/post/2009/11/26/Supporting-multiple-submit-buttons-on-an-ASPNET-MVC-view.aspx,他們使用attributs,但我不能使用它,因爲本地化不是恆定的。