我的网站上有一个带有 mvc c# 的简单电子邮件表单。
如果我添加到文本框 alert("test") 我得到以下异常:
A potentially dangerous Request.Form value was detected from the client (Message="<script>alert("test"...").
我不希望用户能够插入 javascript。我需要 html 编码我会在这个领域做这个
@Html.TextAreaFor(model => model.Message, new { @style = "width:800px;height:300px;" })