Đầu tiên, tôi muốn cho mọi người biết rằng tôi đang sử dụng động cơ aspx chứ không phải động cơ Dao cạo.Làm cách nào để cho phép các thẻ HTML được gửi trong một hộp văn bản trong asp.net?
Tôi có một bảng trong một biểu mẫu. Một trong textbox của tôi chứa các thẻ html như
</br>Phone: </br> 814-888-9999 </br> Email: </br> [email protected]
Khi tôi đi để xây dựng nó nó nó mang lại cho tôi một lỗi mà nói
Một giá trị Request.Form nguy hiểm đã được phát hiện từ khách hàng (QuestionAnswer="...ics Phone:<br/>814-888-9999<br...")
.
Tôi đã thử yêu cầu xác thực = "sai" nhưng nó không hoạt động.
Im xin lỗi tôi đã không thêm mã html của tôi để bạn xem xét cho đến thời điểm này. Tôi kéo một số câu hỏi lên nơi tôi có thể chỉnh sửa nó, nếu cần thiết.
<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
EditFreqQuestionsUser
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<script type="text/javascript">
$(document).ready(function() {
$("#freqQuestionsUserUpdateButton").click(function() {
$("#updateFreqQuestionsUser").submit();
});
});
</script>
<h2>Edit Freq Questions User </h2>
<%Administrator.AdminProductionServices.FreqQuestionsUser freqQuestionsUser = ViewBag.freqQuestionsUser != null ? ViewBag.freqQuestionsUser : new Administrator.AdminProductionServices.FreqQuestionsUser(); %>
<%List<string> UserRoleList = Session["UserRoles"] != null ? (List<string>)Session["UserRoles"] : new List<string>(); %>
<form id="updateFreqQuestionsUser" action="<%=Url.Action("SaveFreqQuestionsUser","Prod")%>" method="post" onsubmit+>
<table>
<tr>
<td colspan="3" class="tableHeader">Freq Questions User Details <input type ="hidden" value="<%=freqQuestionsUser.freqQuestionsUserId%>" name="freqQuestionsUserId"/> </td>
</tr>
<tr>
<td colspan="2" class="label">Question Description:</td>
<td class="content">
<input type="text" maxlength="2000" name="QuestionDescription" value=" <%=freqQuestionsUser.questionDescription%>" />
</td>
</tr>
<tr>
<td colspan="2" class="label">QuestionAnswer:</td>
<td class="content">
<input type="text" maxlength="2000" name="QuestionAnswer" value="<%=freqQuestionsUser.questionAnswer%>" />
</td>
</tr>
<tr>
<td colspan="3" class="tableFooter">
<br />
<a id="freqQuestionsUserUpdateButton" href="#" class="regularButton">Save</a>
<a href="javascript:history.back()" class="regularButton">Cancel</a>
</td>
</tr>
</table>
</form>
</asp:Content>
Tôi đã thêm html để hiển thị cho bạn những gì tôi đã có ban đầu – Yusuf
Hoạt động Hoàn hảo cho tôi cảm ơn! – Krismorte