Unknown server tag 'asp:ScriptManager'
LiveJournal Tags: .Net
This exception has popped up more than once for me, but the answer when searching for help is always the same. Add the following to your web.config (or similar based on your version of .Net). This simple solution of course is never the case for me. If you have the above already in your web.config, the gist of the real problem is that your web.config is actually not loading into the current context due to some other error.<add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
I thought I’d offer some steps I’ve used that seem to always fix the problem for me.
LiveJournal Tags: .Net Workarounds
- If you are using Local IIS Server as your hosting server, switch to the built-in Visual Studio Development Server temporarily and see if the website loads normally.
- If your website loads normally in the built-in web server; sometimes Visual Studio botches the creation of the IIS virtual directory and application. Check IIS admin to see if your settings are correct (or if the virtual directory even exists!).
- Try commenting out the entire script tag (<asp:ScriptManager ID="ScriptManager1" runat="server" />) and see if it reveals the real error. Any other custom controls on the page may fail as well, so keep commenting out until you either see a different error or the page loads normally.
- Add the namespace mapping directly to the page. This is a last resort, but sometimes necessary to just get by the problem.
-
<@ Register Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" TagPrefix="asp" %>
-
