मेरी Default.aspxक्यों संभावित खतरनाक अनुरोध त्रुटि भी ValidateRequest = false
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" ValidateRequest="false" %>
<html>
<head runat="server">
<title>xss demonstration</title>
</head>
<body>
<form id="form1" runat="server">
<div>
We are looking for your feedback.
<asp:TextBox ID="txtFeedback" runat="server" TextMode="MultiLine" />
<br />
<asp:Button ID="submit" runat="server" Text="Submit" onclick="submit_Click" />
<br />
Comment:
<br />
<asp:Literal ID="ltlFeedback" runat="server" />
</div>
</form>
</body>
</html>
Default.aspx.cs
public partial class _Default : System.Web.UI.Page
{
protected void submit_Click(object sender, EventArgs e)
{
this.ltlFeedback.Text = this.txtFeedback.Text;
}
}
है और नीचे है जब मैं में निम्नलिखित आवेदन चलाने के लिए और दर्ज करें पाठ बॉक्स।
<script>alert('Hello')</script>
मुझे निम्न त्रुटि मिलती है।
एक संभावित खतरनाक Request.Form मूल्य ग्राहक (txtFeedback = "चेतावनी ('हैलो ...") से पता चला था।
मेरा प्रश्न है कारण है कि मैं भले ही यह त्रुटि प्राप्त ValidateRequest पेज में गलत पर सेट है?
यह था ऐसा करने से देखभाल करने के लिए की जरूरत है। धन्यवाद –