I need advice on how to fix the code below. It is flagged as a cross site scripting vulnerability. Basically the message is : "The method btnClose_Click() in dPager.aspx.cs send unvalidated data to a web browser on line 10, which can result in the browser
executing malicious code. I have read up on cross site scripting however I don't know how I would
approach fixing this code. So I would really appreciate some help.
1. protected btnClick(object sender, EventArgs e)
2. {
3.
4. try
5. {
6. var strScript = "<script language='javascript'>" +
7. "try{window.opener.document.forms(0)." + Request.QueryString["cntlId"] + ".disabled=false;}" +
8. "catch(error){} finally{self.close();}</script>";
9. ...
Go to the complete details ...