开发者

Element 'UpdatePanel' is not a known element

开发者 https://www.devze.com 2023-03-31 13:37 出处:网络
I have one master page in project. I added scripmanager in that page. In one aspx page I added only update panel control because script manager is in master page.I open both file of master page and sa

I have one master page in project. I added scripmanager in that page. In one aspx page I added only update panel control because script manager is in master page.I open both file of master page and save. Still I am getting an error Element 'UpdatePanel' is 开发者_Python百科not a known element.


Found this here

Basically quit VS2010, delete the content of your 'Reflected Schema Cache', which should be in something like this:

C:\Users\[Your Username]\AppData\Roaming\Microsoft\VisualStudio\10.0\ReflectedSchemas

Restart VS and you should have fixed it.


I had similar issue and I figured that if we have UpdatePanel under "div" or "span" or even "asp:Content" the VS intellisense doesn't complain. Its strange though.


I was experiencing the same problem and also tried to drag and drop from the toolbox to no avail. I finally was able to solve it by adding the targetFramework="4.0" attribute to my compilation tag in my web.config file.


Put the following code in your web config. Just change assembly according to your Ajaxtoolkit

<pages>
  <controls>
    <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
    <add namespace="AjaxControlToolkit" assembly="AjaxControlToolkit" tagPrefix="ajaxToolkit"/>
  </controls>
</pages> 


This is one way to resolve the 'Element 'UpdatePanel' is not a known element' error if you're using VS2008 or targetting earlier frameworks.

You need to explicitly include the following controls/namespaces in your web.config's pages section, contained within system.web.

<pages>
  <controls>
    <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    <add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
  </controls>
</pages>


<%@ Register Tagprefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>

I was getting this error in VS 2015 due to reference to 3.5 in System.Web.Extensions page directive. Make sure it's 4.0


Had the same problem when I changed from an older .Net to a later .Net 4 framework. Also changed to XHTML5. In XHTML5 the is not allowed which was used, which affected parsing, which caused the error/warning. Once I replaced with then it stopped the warnings.


Having the same problem, here is how I solved it:

With your ScriptManager, add it before your UpdatePanel, but close it's tag instead of putting the UpdatePanel and ContentTemplate inside of it.

<asp:ScriptManager ID="nonflashymanager" runat="server"/>
<asp:UpdatePanel id="nonflashyform" runat="server">
    <ContentTemplate>
    </ContentTemplate>
</UpdatePanel>
0

精彩评论

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