开发者

asp.net 4.0 web.config inheritance

开发者 https://www.devze.com 2023-04-02 14:03 出处:网络
I read a lot of articles and questions on the net about this issue, but i don\'t find the right solution for my problem.

I read a lot of articles and questions on the net about this issue, but i don't find the right solution for my problem.

I have a web application (parent) that includes within in few more web applications.

The child applications has their own web.config file, and is set to an Application in the IIS (7.5).

In the root application, i set the <location> tag:

<location path="." inheritInChildApplications="false">
<system.web>
    <compilation debug="true" targetFramework="4.0">
    </compilation>
    <authentication mode="Forms"/>
    <customErrors mode="Off" />
    <pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID">
        <controls>
            <add tagPrefix="web" namespace="CustomControls" assembly="YouSites"/>
            <add tagPrefix="web" namespace="YouSites.Code" assembly="YouSites"/>
            <add tagPrefix="web" tagName="ScriptLoader" src="~/UserControls/ScriptLoader.ascx"/>
            <add tagPrefix="web" tagName="ParameterControl" src="~/UserControls/ParameterControl.ascx"/>
        </controls>
    </pages>

</system.web>
</location>

in the child application, i set the following lines:

    <pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID">
        <controls>
            <add tagPrefix="web" tagName="Content" src="~/UserControls/Content.ascx"/>
            <add tagPrefix="web" tagName="DynamicBox" src="~/UserControls/DynamicBox.ascx"/>
            <add tagPrefix="web" tagName="GlobalStyle" src="~/UserControls/GlobalStyle.ascx"/>
            <add tagPrefix="web" tagName="Image" src="~/UserControls/Image.ascx"/>
            <add tagPrefix="web" tagName="String" src="~/UserControls/String.ascx"/>
            <add tagPrefix="web" namespace="ApiShared.CustomControls.Frame" assembly="ApiShared"/>
        </controls>
    </pages>

Now, when the child application starts, I get the foll开发者_开发问答owing error:

Server Error in '/Layouts/vital' Application.
--------------------------------------------------------------------------------

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: Unknown server tag 'web:GlobalStyle'.

Source Error: 


Line 7:      <script type="text/javascript" src="Assets/jquery-1.4.3.js"></script>
Line 8:      <script type="text/javascript" src="Assets/jquery.simplemodal-1.4.1.js"></script>
Line 9:      <web:GlobalStyle runat="server" />
Line 10:     <title></title>
Line 11: </head>

My idea is that the child web.config is still inheriting from the main one, the paths are just fine, but I don't think it's even being read from the child web.config file.

Thanks in advance,

Gal


Is the child definitely set up as an application in IIS? Does the control dll exist in the childs bin directory? Has the GlobalStyle control been deployed to the child application. Does it work when it's not nested?

It's basically complaining because the type cannot be b resolved.

0

精彩评论

暂无评论...
验证码 换一张
取 消