Within my ASP.NET website, I have implemented an <asp:TextBox />
where the text input is encoded using HttpUtility.HtmlEncode();
Furthermore, the page is equipped with validation controls like
<asp:RequiredFieldValidator />
and <asp:CustomValidator />
, along with several AJAX toolkit components such as <toolkit:ValidatorCalloutExtender />
An issue arises when a user enters </
in the textbox, triggering a Javascript error message:
A potentially dangerous Request.Form value was detected
from the client (ctl00$contentPlaceHolder$ucLookup$tbxLastName="</")
Despite attempts to debug using event handlers like
protected void Page_PreInit(object sender, EventArgs e){}
protected void Page_Init(object sender, EventArgs e){}
protected void Page_PreLoad(object sender, EventArgs e){}
No breakpoints are hit, suggesting the error may be occurring solely on the client-side.
Is there a way to troubleshoot this error effectively? Are there any mechanisms in place to intercept and filter user input to prevent this problem from arising?