ModalDialog - 从客户端检测到潜在危险的Request.Path值

时间:2016-03-03 07:13:58

标签: javascript iis sharepoint web-config

将以下代码添加到Sharepoint 2013页面:

<a href=”javascript:SP.UI.ModalDialog.OpenPopUpPage('http://microsoft.com', null, 100, 100);” >microsoft</a>

点击后我收到此错误:

Server Error in '/' Application.
--------------------------------------------------------------------------------
A potentially dangerous Request.Path value was detected from the client (:). 
  Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 
 Exception Details: System.Web.HttpException: A potentially dangerous Request.Path value was detected from the client (:).
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: 
[HttpException (0x80004005): A potentially dangerous Request.Path value was detected from the client (:).]
   System.Web.HttpRequest.ValidateInputIfRequiredByConfig() +12353567
   System.Web.PipelineStepManager.ValidateHelper(HttpContext context) +166

--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.34274

我有

<location path="_vti_bin/EwaInternalWebService.json">
    <system.web>
      <httpRuntime requestValidationMode="2.0" />
      <webServices>
        <protocols>
          <clear />
        </protocols>
      </webServices>
    </system.web>
  </location>
  <location path="_vti_bin/DynamicGridContent.json">
    <system.web>
      <httpRuntime requestValidationMode="2.0" />
      <webServices>
        <protocols>
          <clear />
        </protocols>
      </webServices>
    </system.web>
  </location>
  <location path="_vti_bin/CrossDomainAjax.ashx">
    <system.web>
      <httpRuntime requestValidationMode="2.0" />
    </system.web>
  </location>

<pages 
            enableSessionState="false"
            enableViewState="true" 
            enableViewStateMac="true"
            validateRequest="false" 
            clientIDMode="AutoID"
        pageParserFilterType="Microsoft.SharePoint.ApplicationRuntime.SPPageParserFilter, Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"
        asyncTimeout="7"
    >
web.config 文件中的

(在 VirtualDirectories CONFIG 文件夹中)。 我也试过使用&#34; / _ layouts / MyPage.aspx&#34;作为具有相同结果的URL。 有什么想法吗?

0 个答案:

没有答案