mvc3下拉列表不起作用,因为unicode字符'';
本文关键字:字符 unicode 因为 下拉列表 不起作用 mvc3 | 更新日期: 2023-09-27 18:00:12
我有以下代码,页面工作正常。我提交它并尝试保存到数据库,我有一个nvarchar(70)字段。当我选择"基金/投资经理"时,由于"/",页面出现错误。我甚至尝试过使用HttpUtility.HtmlEncode("基金投资经理",…),但没有成功。以前有其他人提出过这个问题吗?提前感谢赫什
@Html.DropDownListFor(
model => model.JobDesc,
new SelectList(
new List<Object>{
new { value = "Please Select" , text = "Please Select" },
new { value = "Buy-Side Analyst" , text = "Buy-Side Analyst" },
new { value = "Fund/Investment Manager" , text = "Fund/Investment Manager"},
new { value = "Sell-Side Analyst" , text = "Sell-Side Analyst"},
new { value = "Broker" , text = "Broker"},
new { value = "Other" , text = "Other"}
},
"value",
"text", new { @class = "chk" }
)
)
您尝试过转义字符串吗?
基金//投资经理