Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
345
WebDataTree node text can't contain <>
posted

I am getting 'A potentially dangerous Request.Form value was detected from the client' when I add

 string strIMG = "<img  id='" + "doc" + i + "'onClick=\"docFileDownLoad('" + strFileDown + "');\" height='17px' width='15px' src='" + strSRC + "'" + "alt='" + strALT + "' />";

DocNode.Text = strIMG;
SubNode.Nodes.Add(DocNode);      

I need to add link documents to my page. I already have  validaterequest set to false.

Parents
No Data
Reply
  • 3726
    posted

    Hi there,

    you have to use HttpUtility.HtmlEncode() to html encode the string before assigning it to the Text property. Also you have to use DataTreeNode.NavigateUrl property to make the node to point to same link.

    Hope this helps.

    Thanks,

    Lubomir

Children
No Data