Prevent XSS attack in hyperlink?

Posted by PeerMohamedMydeen under ASP.NET on 12/5/2011 | Points: 10 | Views : 1765 | Status : [Member] | Replies : 0

I have a hyperlink, And I need to do a validation against the querystring in my hyperlink. Is there any way to do validation in the querystring against XSS attack?

<a href='MySecondPage.aspx?ProdcutID=<%# Convert.ToString(DataBinder.Eval(Container.DataItem, "ProductID")) %>'>
<b><%# HttpUtility.HtmlEncode(Convert.ToString(DataBinder.Eval(Container.DataItem, "ProdcutTitle"))) %></b></a>

I have done HtmlEncode for the Hyperlink text. But I want to know about the XSS validation on href URL and its querystring.

Help much appreciated.



(No response found.)

Login to post response