Element 'UpdatePanel' is not a known element - asp.net

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 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>

Related

ajax got error on hosting the webpage

My Website is working fine locally but got problem in making live.
Parser Error Message: Unknown server tag 'asp:ScriptManager'.
I googled this problem and find solution as...
<pages>
<controls> <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</controls> </pages>
I did same but got error again.....
Parser Error Message: Could not load file or assembly 'System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
I have uploaded ajaxtoolkit in Bin folder???? Please help me out...
Most likely you haven't configure the right .net version. Check with your webhosting company or control panel to see what .net version your site is using. You can also try smarterasp.net, they let you set your own version via their control panel too.

how to upgrade code to a new version of third party control

I have a web application in asp.net 3.5 where i have been using some third party controls i.e. Devexpresv9.2
and on the pages where i am using these controls i normally has to call the register tag on the page markup like for ex:
<%# Register Assembly="DevExpress.Web.v9.2, Version=9.2.9.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
Namespace="DevExpress.Web.ASPxCallback" TagPrefix="dxcb" %>
<%# Register Assembly="DevExpress.Web.ASPxGridView.v9.2.Export, Version=9.2.9.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
Namespace="DevExpress.Web.ASPxGridView.Export" TagPrefix="dxwgv" %>
Now i have updated the version of devexpress controls installed on my machine and it has stopped working because the version installed on my machine is v10.0 but my code is looking for v9.2
Please advise how can i modify my code in such a way that in future if i install another version then i don't have to modify all the pages and references again. May be something in web.config that can help me or anything generic??
Thanks
Use the project converter which is designed for this. It is located under the Windows Start Menu at "Develper Express V2010 vol1 -> Components -> Tools -> Project Converter". This will automatically change all of your references to the current version.
Project Converter Documentation
I think you answered your own question. You don't need to add the assembly reference on each page, put it in web.config.
<system.web>
<compilation>
<assemblies>
<add assembly="DevExpress.Web.v9.2, Version=9.2.9.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a">
<add assembly="DevExpress.Web.ASPxGridView.v9.2.Export, Version=9.2.9.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a">
</assemblies>
</compilation>
<pages>
<controls>
<add namespace="DevExpress.Web.ASPxCallback" assembly="DevExpress.Web.v9.2" tagprefix="dxcb">
<add namespace="DevExpress.Web.ASPxGridView.Export" assembly="DevExpress.Web.ASPxGridView.v9.2.Export" tagprefix="dxwgv">
</controls>
</pages>
</system.web>

Simple ajax asp.net calendar extender not working

I've made a new project with one page and a reference to AjaxControlToolkit.dll
The calendar extender below doesn't work, what have I done wrong?
<%# Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebApplication1._Default" %>
<%# Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<ajaxToolkit:CalendarExtender runat="server" TargetControlID="TextBox1" CssClass="ClassName" Format="MMMM d, yyyy" />
</div>
</form>
</body>
</html>
Try using the ajaxtoolkit ScriptManager instead of the asp one..everything else looks fine
<ajaxToolkit:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server" > </ajaxToolkit:ToolkitScriptManager>
The above answer is correct; however, it didn't work for me. I tried instead to drag the ToolkitScriptManager into my form, and it was rendered as <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"></asp:ToolkitScriptManager>"<. It worked for me then. Note that it was "asp.ToolkitScriptManager", not "ajaxToolkit:ToolkitScriptManager". Perhaps this is a change in the version of the Ajax Control Toolkit I am using?
No, Its what ever you set the tagPrefix as, It could be cc1 or asp or ajaxToolkit
<%# Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
regarding Ajax Control Toolkit 7.1213.0
Since you are using the ajax control toolkit you will need to use ToolScriptManager instead of just ScriptManager.
Drag and drop ToolScriptManager or just type
<asp:ToolkitScriptManager runat="server"></asp:ToolkitScriptManager>
if not working put this in the begining of web page.
<%# Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
You can use CalendarExtender right after targeted textbox.
<asp:TextBox runat="server" ID="txtDate1" />
<asp:CalendarExtender ID="txtDate1_CalendarExtender" runat="server" Enabled="True" TargetControlID="txtDate1">
</asp:CalendarExtender>
If these are not working you should edit your Web.config file and add necessary configurations. Add configurations to ajax controls which will need you to refer another tutorial.
<httpHandlers>
<remove path="*.asmx" verb="*"/>
<add path="*.asmx" verb="*" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>
<add path="*_AppService.axd" verb="*" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>
<add path="ScriptResource.axd" verb="GET,HEAD" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>
<add path="CrystalImageHandler.aspx" verb="GET" type="CrystalDecisions.Web.CrystalImageHandler, CrystalDecisions.Web, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
<add path="Reserved.ReportViewerWebControl.axd" verb="*" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" validate="false"/>
</httpHandlers>
<system.web></system.web>
Since it is already answered, but just to let the developers facing this problem NOW , talking about the version Update October 2015: which is now maintained by DevExpress
I upgraded my VS 2013 Web Forms application project to ajax via Nuget &
I faced the same problem, Calender control not working, having all the code perfect
So the solution that worked for me was :
1. I did this:
2. I installed it via this New installer
3. I created a New project in my VS 2013
4. Moved my existing code to this project and
it worked !!
plus, thers is no <ajaxToolkit:ToolkitScriptManager now , you have to Use the standard ScriptManager now
Sigh... I know this is question was dated, but in case others arrive and these solutions don't solve the problem then here is something to check. We have a legacy web forms app that I spent most of the morning troubleshooting because the calendar extender controls just stopped working on a specific page. There were no patches or service packs that had been run on server/local dev pc and no Ajax assembly version change and no recent change to the page.
It turns out that a register startup script in page load was referring to a JavaScript function that no longer existed in the external js file hence a JavaScript Error on page load stopped the ajax control initialization/functionality. So check your developer tools (Chrome seems the best) for JavaScript errors that may stop other JavaScript initialization scripts from running for calendar extender and similar.

Defining tagPrefixes in Web.config help

I am having a little bit of trouble getting my aspx pages to recognize my tagPrefixes.
I have the standard ASP ones defined...
<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"/>
Then I have my custom controls defined below that but I do not think I am defining them properly because sometimes the page does not see any controls in the current context other times they work like a champ...
<add tagPrefix="mri" namespace="Mri.Controls" assembly="Mri.Controls"/>
<add tagPrefix="mri" namespace="Mri.Controls.Inputs" assembly="Mri.Controls"/>
<add tagPrefix="mri" namespace="Mri.Controls.Inputs.DropDowns" assembly="Mri.Controls"/>
<add tagPrefix="mri" namespace="Mri.Controls.Inputs.Search" assembly="Mri.Controls"/>
I have one namespace "Mri.Controls" and inside of that namespace I have several sub-folders, "Inputs" -> "DropDowns" etc...
What am I doing wrong? Currently the regular ASP controls are giving me an error: The name "blahBlah" does not exist in the current context.
The sub-folders may or maynot become part of the namespace. By default, Visual Studio does include them when creating new classes but that can be removed in the class. If you moved the controls to the sub-folders, then the folder's name is likely not part of the namespace.
Also, make sure you are referencing your controls assembly or project within Visual Studio.
Do you not also need the tagName attribute e.g.
<add tagPrefix="mri" tagName="Search" namespace="Mri.Controls.Inputs.Search" assembly="Mri.Controls"/>
<mri:Search ID="Search" runat="server"/>

Import Namespace System.Query

I am trying to load Linq on my .Net 3.5 enabled web server by adding the following to my .aspx page:
<%# Import Namespace="System.Query" %>
However, this fails and tells me it cannot find the namespace.
The type or namespace name 'Query' does not exist in the namespace 'System'
I have also tried with no luck:
System.Data.Linq
System.Linq
System.Xml.Linq
I believe that .Net 3.5 is working because var hello = "Hello World" seems to work.
Can anyone help please?
PS: I just want to clarify that I don't use Visual Studio, I simply have a Text Editor and write my code directly into .aspx files.
I have version 2 selected in IIS and I
Well, surely that's your problem? Select 3.5.
Actually, here's the real info:
http://www.hanselman.com/blog/HowToSetAnIISApplicationOrAppPoolToUseASPNET35RatherThan20.aspx
What does the part of your web.config file look like?
Here's what it looks like for a brand new ASP.NET 3.5 project made with Visual Studio 2008:
<assemblies>
<add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
</assemblies>
I found the answer :) I needed to add the following to my web.config:
<assemblies>
<add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Data.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
</assemblies>
Then I could add the following to my code:
<%# Import Namespace="System.Linq" %>
#Will,
Thanks for your help. I have accepted one of your answers :)
Make sure your project is set to target 3.5, and not 2.0.
As others have said, your 'var' test is a test of C#3 (i.e. VS2008), not the 3.5 framework.
If you set the project framework target settings properly, you should not expect to need to manually add dll references at this point.
The var hello stuff is compiler magic and will work without Linq.
Try adding a reference to System.Core
Sorry, I wasn't clear. I meant add System.Core to the web project's references, not to the page.
The Import on the page are basically just using statements, allowing you to skip the namespace on the page.
The csproj file might be missing the System.Core reference.
Look for a line in the csproj file like this:
<Reference Include="System" />
And add a line below it like this:
<Reference Include="System.Core" />

Resources