ajax Control Toolkit 4.1.40412.0 chart controls cannot be compiled? - asp.net

I'm using Ajax chart(Pie chart, Line chart, bar chart) in my project. All Reference to this ajax is properly. And it worked well in the old version . When I upgrade to ajax Control Toolkit 4.1.40412.0 . I cannot compile my project anymore. The error display:
Warning 2 Element 'PieChart' is not a known element. This can occur if there is a compilation error in the Web site, or the web.config file is missing.
I added in web.config:
<pages validateRequest="false" clientIDMode="AutoID">
<controls>
<add tagPrefix="asp" assembly="AjaxControlToolkit"
namespace="AjaxControlToolkit" />
</controls>
</pages>
and in my HTML form:
<asp:PieChart ID="PieChart1" runat="server" ChartHeight="535" ChartWidth="535"
Visible="true" borderstyle="None" forecolor="White"></asp:PieChart>
What is wrong with this version in my webconfig?
And I also remember to add Reference:
And its property is:

This is because of the tagPrefix="asp". You are actually getting an error
The type or namespace name 'PieChart' does not exist in the namespace 'System.Web.UI.WebControls' (are you missing an assembly reference?)
To make it work, change the tag prefix
web.config
<pages>
<controls>
<add tagPrefix="ajaxToolkit" assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" />
</controls>
</pages>
markup
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<ajaxToolkit:PieChart ID="PieChart1" runat="server"
ChartHeight="535"
ChartWidth="535"
Visible="true"
BorderStyle="None"
ForeColor="White">
</ajaxToolkit:PieChart>
NuGet Package Link: https://www.nuget.org/packages/AjaxControlToolkit/

Related

Visual Studio 2013 - Unrecognized Namespace in Markup

My VS2013 (using .NET 4.5) shows the weird error
Unrecognized tag prefix or device filter 'web'.
on every Control of my page.
Here's how my web.config looks like:
<pages controlRenderingCompatibilityVersion="4.0">
<controls>
<add tagPrefix="web" namespace="Customer.PL.App.Code" assembly="Customer.PL.App"/>
<add tagPrefix="telerik" namespace="Telerik.Web.UI" assembly="Telerik.Web.UI"/>
<add tagPrefix="company" namespace="company.Telerik.Web.UI" assembly="company.Telerik.Web"/>
<add tagPrefix="web" src="~/Code/UC/GridButtons.ascx" tagName="GridButtons"/>
<add tagPrefix="web" src="~/Code/UC/REchteList.ascx" tagName="RechteList"/>
<!-- Wizard User Controls -->
<add tagPrefix="web" src="~/OM/UC/Auftragspositionen.ascx" tagName="UCAuftragspositionen"/>
<add tagPrefix="web" src="~/OM/UC/Auftragsdaten.ascx" tagName="UCAuftragsdaten"/>
<add tagPrefix="web" src="~/OM/UC/Lieferadresse.ascx" tagName="UCLieferadresse"/>
<add tagPrefix="web" src="~/OM/UC/Vorschau.ascx" tagName="UCVorschau"/>
</controls>
</pages>
I tried removing the other Prefixes but it doesn't fix it.
It makes my intellisense crash and evertime I type
<web:
it autocompletes as
<asp:ProxyWebPartManager:
it's really annoying.
Note: Same error in VS2012. I even tried restarting the whole computer, but no change.
Edit: Something in the Stackoverflow formatting screwed my text. Somehow you can't write a tag like < web: (just without the space) outside a code block.

RadControl disappear and unrecognized tag prefix

i need to enhance the application which developed by other colleagues, the source code located at share folder such as \10.1.1.1\App1
and i had map the share folder as network drive such as T: drive
my colleagues can open the apps by VS and work properly, but when i open it by VS2010, it cannot display the RadControl in Toolbox, display unrecognized tag prefix error message and cannot reference telerik function in code behind.
i had tried many methods that found on forum and website but doesn't work. e.g.
Using Caspol.exe to grant .NET applications rights to a remote ...
Caspol.exe –m –ag 1.2 –url file://\10.1.1.13/App1/* FullTrust
Caspol.exe –m –ag 1.2 –url file://\T:/* FullTrust
Add reference to web.config
Remove dll from bin folder
refer Telerik.Web.UI assembly and register the tagprefix in the web.config or directly into the page:
<system.web>
<compilation debug="false" targetFramework="4.5.1" />
<httpRuntime targetFramework="4.5.1" />
<pages>
<controls>
<add tagPrefix="telerik" namespace="Telerik.Web.UI" assembly="Telerik.Web.UI" />
</controls>
</pages>
or in the aspx page:
<%# Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

Ajax control toolkit asssembly reference error

Hi I am trying to install the ajax controll toolkit in an asp.net project.I have used Nugget to download the library into the project and loaded each control into the toolbox but when I try to use any of the controls I get this error:
Error 3 The type 'System.Web.UI.Design.ExtenderControlDesigner' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Web.Extensions.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. D:\Projects IDE\Visual Studio\C# Book\ASP.NET\WebSite12\Default.aspx 14
After reading this error I added this in the configuration file:
<assemblies>
<add assembly="System.Web.Extensions.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</assemblies>
I understand that this should point to the assembly I need but it does not work and also maybe someone can tell me from where should I have goten this string in the first place I have seen similar strings used for providersi in asp.net at the type property and I cant understand from where should I get them especialy the PublicKeyToken.
This is my entire code:
<%# Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<%# Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<!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></title>
</head>
<body>
<form id="form1" runat="server">
<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
</asp:ToolkitScriptManager>
<asp:AlwaysVisibleControlDesigner ID="AlwaysVisible" runat="server">
</asp:AlwaysVisibleControlDesigner>
</form>
</body>
</html>
And this is the contents of the web.config file:
<?xml version="1.0" encoding="utf-8"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<system.web>
<compilation debug="false" targetFramework="4.0" >
<assemblies>
<add assembly="System.Web.Extensions.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</assemblies>
</compilation>
<pages>
<controls>
<add tagPrefix="asp" assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" />
</controls>
</pages>
</system.web>
</configuration>
Also a second configuration file has been added after installing the ajax control toolkit via nugget called packages.config:
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="AjaxControlToolkit" version="4.1.60919" targetFramework="net40" />
</packages>
What am I doing wrong here?Why am I getting that error?
EDIT
It turns out I had to add an aditional assembly for this to work:
<assemblies>
<add assembly="System.Web.Extensions.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
</assemblies>
Now I am getting an error that says:
**Error 2 Type 'AjaxControlToolkit.AlwaysVisibleControlDesigner' does not have a public property named 'TargetControlID'. D:\Projects IDE\Visual Studio\C# Book\ASP.NET\WebSite12\Default.aspx 14
**
This is the code:
<asp:AlwaysVisibleControlDesigner ID="AlwaysVisible" runat="server" TargetControlID="Panel1" HorizontalOffset="10" HorizontalSide="Right" VerticalOffset="10" >
</asp:AlwaysVisibleControlDesigner>
I am prety sure that this should be corect I got this example from the book Proffesional asp.net in C# and VB
Somehow my code is not getting the ajaxcontrol toolkit properties.How can I corect this?
I faced this problem a long time ago.
The problem with my code was that it used two different versions of Ajax control toolkit.
The Toolbox had the latest Ajax control toolkit(the one With color picker, editor control) and the reference added in the project was of a older version.
How to solve:
Remove the Ajax Control tab from the toolbox.
Re-add the tab and right-click on the tab, Select Choose Items and browse to the
AjaxControltoolkit.dll file in your own project and press OK(Just
to make sure that we are using the same version in both the places)
Clean and rebuild the solution and you are ready to go.

Element 'UpdatePanel' is not a known element

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>

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.

Resources