Last post Nov 23, 2015 10:55 AM by Mukesh_Kumar
Nov 23, 2015 10:14 AM|ckcheah|LINK
I have one web site develop using vs2008 version and I trying to upgrade to vs2015 community version. When I change from .Net framework 2.0 to 4.0. Below error appear:
Error BC30451 'ScriptManager' is not declared. It may be inaccessible due to its protection level
I have a script manger with ID='ScriptManager1'. But when I goto code behind, I couldn't found this component.
How was caused this happen? I have tried many ways but still cannot solved. Help.. Thanks.
Nov 23, 2015 10:37 AM|uid895650|LINK
Have you given your code a clean and rebuild?
Also, try removing and re-adding the script manager control - I find that when projects have been upgraded in the past that items get renamed by the designer and there is a mismatch between the page, codebehind and designer files due to renaming.
It's also possible that during the upgrade referenced namespaces were removed from your application. ScriptManager is a member of System.Web.UI. - ensure that this is still referenced.
You could also possible try reinstalling the Ajax components and then restart the project.
Hope this helps.
Nov 23, 2015 10:55 AM|Mukesh_Kumar|LINK
ScriptManager' is not declared means you are not referring to the related namespace. ScriptManager is a member of System.Web.UI. Refer this namespace in your class file.
You can reinstall the ajax component and restart the project. or you can also check your web.config setting.
Hope this will help you.