来自ASP。NET MVC RC1发行说明(第15页)。
在此版本中,默认情况下,点
字符会自动替换
ID属性。因此,示例TextBox
呈现以下标记:
<input
type="text" name="Person.FirstName"
id="Person_FirstName" />
要更改
默认替换字符,您可以
HtmlHelper。IDDotReplacementChar
我想改用。
FYI。查看源代码
http://www.codeplex.com/aspnet
,RC1中属性的真实名称似乎是IdAttributeDotReplacement。相关代码片段如下。要保留点,您只需将此属性设置为点字符,即用其自身替换点字符。
public static string IdAttributeDotReplacement {
get {
if (String.IsNullOrEmpty(_idAttributeDotReplacement)) {
_idAttributeDotReplacement = "_";
}
return _idAttributeDotReplacement;
}
set {
_idAttributeDotReplacement = value;
}
}