2

如果我在 web conашп 目标中设置为 4.5 框架是下一个,我发现了 sitecore 管理页面的一个有趣问题

>  compilation defaultLanguage="c#" debug="true" targetFramework="4.5"
> enablePrefetchOptimization="true" 

我得到下一个错误:

Parser Error 
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately. 

Parser Error Message: The base class includes the field 'StartPage', but its type (System.Web.UI.HtmlControls.HtmlGenericControl) is not compatible with the type of control (System.Web.UI.HtmlControls.HtmlIframe).

Source Error: 


Line 71:             </div>
Line 72:             <div id="SDN">
Line 73:                 <iframe id="StartPage" runat="server" allowtransparency="true" frameborder="0" scrolling="auto"
Line 74:                     marginheight="0" marginwidth="0" style="display: none"></iframe>
Line 75:             </div> 

如果 targetFramework arrrib 是 4.0 一切正常。如何解决?我的目标是在完整的 4.5 FW 模式下工作,我已经另外设置了

<httpRuntime 
encoderType="System.Web.Security.AntiXss.AntiXssEncoder,System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"   
maxRequestLength="512000" 
executionTimeout="600" 
enableKernelOutputCache="false" 
targetFramework="4.5" 
requestValidationMode="4.0"/>

<add key="ValidationSettings:UnobtrusiveValidationMode" value="None"/>

谢谢

4

6 回答 6

5

在 Sitecore 6.6 中找到了一个超级简单的解决方案。只需将 iFrame 重命名为 div!

      <div id="SDN">
            <div id="StartPage" runat="server" allowtransparency="true" frameborder="0" scrolling="auto"
                marginheight="0" marginwidth="0" style="display: none"></div>
        </div>
于 2013-04-17T00:46:20.490 回答
2

您的目标框架必须为 4.0,Sitecore 才能正常工作。尚不支持 4.5 版

于 2012-12-15T00:31:41.140 回答
2

首先,您需要在 Website\sitecore\login 中找到并编辑文件 default.aspx。

改变这个:

<div id="SDN">
    <iframe id="StartPage" runat="server" allowtransparency="true" frameborder="0" scrolling="auto"
                marginheight="0" marginwidth="0" style="display: none"></iframe>
</div>

对此:

<div id="SDN">
    <div id="StartPage>   </div>
</div>

保存此文件。

The iframe displays browser compabitibilty information from sitecore on the right side of the login page.

What happens is that when you use .NET 4.5, the iframe compiles to an HtmlIframe control. The code behind file from sitecore however has the iframe as an HtmlGeneric control. Hence the message.

By changing the iframe to a div, ASP.NET will generate an HtmlGeneric from the .aspx page which matches what is in the compiled code behind and the login page is then able to load.

于 2015-04-01T22:01:55.423 回答
0

我遇到了同样的错误,并在 web.config 文件的复杂条目中添加了“targetFrameowkr=4.5.1”并修复了问题。

于 2014-06-20T01:04:04.980 回答
0

I have faced the same problem and i have changed the target framework from 4.0 to 4.5 in web.config file.

于 2017-08-07T09:51:04.797 回答
-2

我找到了解决方案,我只需要自定义登录页面。

于 2012-12-15T06:58:16.030 回答