Monday, March 26, 2012

Visual Studio wont recognize some AJAX components when there is a master page

This is a really weird thing. I have installed AJAX and the toolkits and the validators, and everything was working fine. Then, suddenly, Visual Studio won't let me switch to design view b/c the script Manager and the update panels are now "not known elements," and so are all the labels, panels, dropdownlists, etc inside the update panels. Oddly enough, the components in the AJAX toolkit are still recognized just fine. when this problem first started happening, i would click over to the master page and click back to the aspx page and everything was fine. Now that doesn't even work. And the craziest part is that the web site runs just fine when I debug it, AJAX functionality and all!

I would have blamed this on the way I installed the AJAX framework, but this only happens on pages with master pages.

Does anyone have any experience with this? Or is it just my machine? No one else here at work is having this problem, but I am the only one who is really using AJAX.

Any ideas would be welcome. Thanks in advance

Hi,

As far as I know, the error message indicates the issue is related to permission. It seems your ASP.NET applications run in partial trust. This is configured through the <trust level="xxx" /> setting in web.config or machine.config. Please change the "xxx" to medium and try again to figure out whether the problem still occurs.

Best Regards


Thanks for your suggestion. I don't even have any trust level permissions in my web.config files, so I am assuming that the problem is in my machine.config file. But before I go messing around in there, I would like to try to override it in the web.config. This is what I have in my web.config. But the error I am getting on the page declaration of the default.aspx page is "Unable to read the security policy file for trust level 'medium'." Where are the policy files located?

<location allowOverride="false">
<system.web>
<securityPolicy>
<trustLevel name="Full" policyFile="internal"/>
<trustLevel name="High" policyFile="web_hightrust.config"/>
<trustLevel name="Medium" policyFile="web_mediumtrust.config"/>
<trustLevel name="Low" policyFile="web_lowtrust.config"/>
<trustLevel name="Minimal" policyFile="web_minimaltrust.config"/>
</securityPolicy>
<trust level="medium" originUrl=""/>
</system.web>
</location>

No comments:

Post a Comment