A potentially dangerous Request.QueryString value was detected from the client when sending html markup from jquery post call to asp.net page -
i m making ajax call using jquery asp.net page acts ajax server page save data sending in query string. in asp.net page when trying read querystring getting error:
a potentially dangerous request.querystring value detected client...
i have set validaterequest="false"
in page. dont want set pages. did in page level instead of config level:
var content = "<h3>sample header</h3><p>sample para</p>" content = encodeuricomponent(content); var url = "../lib/ajaxhandler.aspx?mode=savecontent&page=home<xt=" + content; $.post(url, function (data) { //check return value , });
and in asp.net page:
<%@ page language="c#" autoeventwireup="true" codebehind="ajaxhandler.aspx.cs" validaterequest="false" inherits="myproject.lib.ajaxhandler" %>
but when sending plain text instead of html markup, works fine.
if asp.net 4, there breaking change validaterequest
. see this stackoverflow question more information on requestvalidationmode
.
Comments
Post a Comment