开发者

HTML Encode for @Html.TextAreaFor(model =>model.Product.LongDesc ,10,100,null)

开发者 https://www.devze.com 2023-03-16 07:38 出处:网络
I have LongDesc field which can have html text and I want to save开发者_Go百科 that in database using model binding. I don\'t want to skip the xss security part by making ValidateInput to false. Is th

I have LongDesc field which can have html text and I want to save开发者_Go百科 that in database using model binding. I don't want to skip the xss security part by making ValidateInput to false. Is there any way I can use @MvcHtmlString.Create or @Html.Raw along with Model binding


You could set AllowHtml attribute on LongDesc field and use AntiXSS library to check input value.

0

精彩评论

暂无评论...
验证码 换一张
取 消