您的位置:程序门 -> .net技术 -> asp.net



调用ajax之后弹出页面,主画面报错


[收藏此页] [打印本页]选择字色:背景色:字体:[][][]


调用ajax之后弹出页面,主画面报错[已结贴,结贴人:m_halfman]
发表于:2007-03-16 15:31:40 楼主
一个页面上,有一个按钮,点击之后用ajax访问了一下db,根据结果,弹出一个页面。
hidajaxrtn是主画面上的一个hidden,用来放ajax画面写回的内容。
结果现在弹出后,主页面马上就会报错(弹出页面正常),错误如下:

a   potentially   dangerous   request.form   value   was   detected   from   the   client   (hidajaxrtn= "have   <!doctype   html   publi... ").  
description:   request   validation   has   detected   a   potentially   dangerous   client   input   value,   and   processing   of   the   request   has   been   aborted.   this   value   may   indicate   an   attempt   to   compromise   the   security   of   your   application,   such   as   a   cross-site   scripting   attack.   you   can   disable   request   validation   by   setting   validaterequest=false   in   the   page   directive   or   in   the   configuration   section.   however,   it   is   strongly   recommended   that   your   application   explicitly   check   all   inputs   in   this   case.  

exception   details:   system.web.httprequestvalidationexception:   a   potentially   dangerous   request.form   value   was   detected   from   the   client   (hidajaxrtn= "have   <!doctype   html   publi... ").

source   error:  

an   unhandled   exception   was   generated   during   the   EXECution   of   the   current   web   request.   information   regarding   the   origin   and   location   of   the   exception   can   be   identified   using   the   exception   stack   trace   below.    

stack   trace:  


[httprequestvalidationexception   (0x80004005):   a   potentially   dangerous   request.form   value   was   detected   from   the   client   (hidajaxrtn= "have
<!doctype   html   publi... ").]
      system.web.httprequest.validatestring(string   s,   string   valuename,   string   collectionname)
      system.web.httprequest.validatenamevaluecollection(namevaluecollection   nvc,   string   collectionname)
      system.web.httprequest.get_form()   +113
      system.web.ui.page.getcollectionbasedonmethod()
      system.web.ui.page.determinepostbackmode()
      system.web.ui.page.processrequestmain()
      system.web.ui.page.processrequest()
      system.web.ui.page.processrequest(httpcontext   context)
      system.web.callhandlerEXECutionstep.system.web.httpapplication+iEXECutionstep.EXECute()
      system.web.httpapplication.EXECutestep(iEXECutionstep   step,   boolean&   completedsynchronously)
发表于:2007-03-16 15:38:141楼 得分:0
认为你回传的代码可能有危险,不给你处理,把窗体设置成不验证就行了。
发表于:2007-03-16 15:39:522楼 得分:40
在aspx文件最上面一行加上   validaterequest= "false ",如下所示:

<%@   page   language= "c# "   autoeventwireup= "true "   codefile= "doccontent.aspx.cs "   inherits= "edit_docs_doccontent "   validaterequest= "false "   %>
发表于:2007-03-16 15:46:103楼 得分:0
帮你顶
发表于:2007-03-16 15:53:294楼 得分:0
ivy_zheng(最后一只恐龙)   的方法有效,谢谢。
多问一句,弹出窗口之后,原页面会刷新,能不让它刷新吗?
发表于:2007-03-16 18:10:435楼 得分:0
ajax肯定有办法,你的刷新应该是程序的问题


快速检索

最新资讯
热门点击