C# 如何使用include Html.ActionLink本地化文本

C# 如何使用include Html.ActionLink本地化文本,c#,asp.net,asp.net-mvc-3,razor,localization,C#,Asp.net,Asp.net Mvc 3,Razor,Localization,我有文本要像这样本地化 <p>Please enter your user name and password. @Html.ActionLink(@Resources.Register, "Register") if you don't have an account. </p> (这不起作用,因为链接变成了字符串) 或者我必须把这一段分成两部分吗?你应该这样做: @Html.Raw(string.Format(Resources.LogOn_Enter_Messag

我有文本要像这样本地化

<p>Please enter your user name and password. @Html.ActionLink(@Resources.Register, "Register") if you don't have an account. </p>
(这不起作用,因为链接变成了字符串)

或者我必须把这一段分成两部分吗?

你应该这样做:

@Html.Raw(string.Format(Resources.LogOn_Enter_Message, Html.ActionLink(@Resources.Register, "Register")))
并存储本地化字符串:

 <p>Please enter your user name and password. {0} if you don't have an account. </p>
请输入您的用户名和密码。{0}如果您没有帐户

gaah我离得太近了:-)谢谢。
 <p>Please enter your user name and password. {0} if you don't have an account. </p>