7
我应该使用哪一个?我应该在输入字段中对html值进行编码吗?
<input type="hidden" name="first_name"
value="<%= person.first_name %>" />
或
<input type="hidden" name="first_name"
value="<%= Html.Encode(person.first_name) %>" />
我应该使用哪一个?我应该在输入字段中对html值进行编码吗?
<input type="hidden" name="first_name"
value="<%= person.first_name %>" />
或
<input type="hidden" name="first_name"
value="<%= Html.Encode(person.first_name) %>" />
你应该了Html.Encode否则一个“在该领域可能会导致注入问题
如果你想为一个HTML元素设置的默认值,你有使用character references来编码the HTML special characters内部值
Gumbo能不能请你去[聊天](http://chat.stackoverflow.com/rooms/49378/room-for-royi-namir-and-gumbo)我有小号购物中心关于你的答案的问题 – 2014-03-10 08:06:45