On my local machine it's working but it's not working on server
error is showing like this
Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: Unknown server tag 'asp:Chart'.
Source Error:
In the web.config section add the following:
<system.web>
<httpHandlers>
<add tagPrefix="asp"
namespace="System.Web.UI.DataVisualization.Charting"
assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</httpHandlers>
</system.web>
Check if the assembly is installed on the server, and check if your web.config on the server includes the control assembly and namespace in the <controls> section.
For instance
<add tagPrefix="asp"
namespace="System.Web.UI.DataVisualization.Charting"
assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
Check this link for more details, charts for MSDN - http://msdn.microsoft.com/en-us/library/vstudio/hh297118(v=vs.100).aspx
Try the below code:
just to remove the following entry from web.config section:
<httpHandlers>
<add path="ChartImg.axd" verb="GET,HEAD,POST" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler,
System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral,PublicKeyToken=31bf3856ad364e35"
validate="false" />
</httpHandlers>
Also make sure that section has the following:
<handlers>
<remove name="ChartImageHandler" />
<add name="ChartImageHandler" preCondition="integratedMode" verb="GET,HEAD,POST"
path="ChartImg.axd" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler,
System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</handlers>
Related
I've encountered an odd problem: I'm trying to migrate an ASP.NET 4.0 website to an ASP.NET web application. Visual Studio's "Convert to Web Application" function actually worked quite nicely, but the only thing that's not working are the references to charts. I'm getting the error:
The type or namespace name 'Chart' does not exist in the namespace
'System.Web.UI.WebControls'
From the .designer file. The designer is automatically creating this type of code:
protected global::System.Web.UI.WebControls.Chart ClientHoursPie;
Based on research I have done, the proper 4.0 namespace to use for charts is System.Web.UI.DataVisualization.Charting. I have added the following components in the web.config (copied from the original website, which was working fine):
<httpHandlers>
<add path="ChartImg.axd" verb="GET,HEAD,POST" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>
</httpHandlers>
<compilation debug="true" targetFramework="4.0">
<assemblies>
<add assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</assemblies>
</compilation>
I can correct the namespaces in the designer files but each time the aspx file is saved, the designer reverts back to the old namespace.
I would love to avoid having to rebuild all of the individual pages from scratch. Is there a setting somewhere that I've missed?
Thanks in advance.
I was able to solve the problem by adding a few entries to web.config that I had missed. Anyone experiencing this problem needs to make sure you include:
<pages>
<controls>
<add tagPrefix="asp" namespace="System.Web.UI.DataVisualization.Charting" assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</controls>
</pages>
And this (in system.webServer section):
<handlers>
<remove name="ChartImageHandler"/>
<add name="ChartImageHandler" preCondition="integratedMode" verb="GET,HEAD,POST" path="ChartImg.axd" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</handlers>
I have a developed a website with Charts in it. On deploying I found that it gives internal server error 500.23. I removed the section in web.config
<httpHandlers>
<add path="ChartImg.axd" verb="GET,HEAD,POST" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false" />
</httpHandlers>
the site worked but the pages with the Charts stopped working. Exception shown is
"Error executing child request for ChartImg.axd."
As suggested in few other post I have already checked the section the are configured as
<handlers>
<remove name="ChartImageHandler" />
<add name="ChartImageHandler" preCondition="integratedMode" verb="GET,HEAD,POST"
path="ChartImg.axd" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</handlers>
Kindly help me and inform me what am I doing wrong?
I have an VS2010 ASP.NET 4 web site app, to which I added the new Chart control.
When I deployed it to our web server, we get a" Internal Server Error 500." message.
I noticed that the following lines were added to the web.config since the last release, related to the chart control:
<system.web>
<httpHandlers>
<add path="ChartImg.axd" verb="GET,HEAD,POST" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
validate="false" />
</httpHandlers>
If I remove this added code from the web.config, the site works--Except for the charting functionality.
How do I get the site and the chart page to work?
This is not an issue on IIS versions < 7.
Make sure you comment out the entry in the system.web section:
<httpHandlers>
<add path="ChartImg.axd" verb="GET,HEAD,POST" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler,
System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral,PublicKeyToken=31bf3856ad364e35"
validate="false"/>
</httpHandlers>
And make sure the system.webserver section has the following:
<handlers>
<remove name="ChartImageHandler" />
<add name="ChartImageHandler" preCondition="integratedMode" verb="GET,HEAD,POST"
path="ChartImg.axd" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler,
System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</handlers>
Check the event log for the server in question. The web servers 500 error will be an application exception in the event log. Fix the cause of that exception and you should be good to go.
In Web Config :
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0">
<assemblies>
<add assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/></assemblies></compilation>
</system.web>
<appSettings>
<add key="ChartImageHandler" value="storage=file;timeout=20;" />
</appSettings>
<system.web>
<httpHandlers>
<add path="ChartImg.axd" verb="GET,HEAD,POST" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>
</httpHandlers>
<pages>
<controls>
<add tagPrefix="asp" namespace="System.Web.UI.DataVisualization.Charting" assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</controls>
</pages>
</system.web>
<system.webServer>
<handlers>
<remove name="ChartImageHandler"/>
<add name="ChartImageHandler" preCondition="integratedMode" verb="GET,HEAD,POST" path="ChartImg.axd" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</handlers>
</system.webServer>
</configuration>
I have a virtual directory setup in one of my web apps that needs to not inherit the web.config of the main app so it can run on it's own. I am wondering how I can do this because right now when I hit it (mainwebapp.domain.com/virdir) it throws an error saying it can't find some dependencies that are listed in the main apps web.config (shows main app web.config in the error message), this virdir contains it's own little app that needs to just run standalone.
Here is the problem area:
Line 143: <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/>
Line 144: <add verb="*" path="*.mvc" validate="false" type="System.Web.Mvc.MvcHttpHandler, System.Web.Mvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
Line 145: <add verb="*" path="weborb.aspx" type="Weborb.ORBHttpHandler" />
Line 146: <add verb="*" path="codegen.aspx" type="Weborb.Management.CodeGen.CodegeneratorHttpHandler" />
Line 147: <!--elm <add verb="POST,GET,HEAD" path="elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah" /> elm-->
error is on line 145: "Could not load type 'Weborb.ORBHttpHandler'." (this is the parent web.config that it is showing the error in, which I do not want to modify)...
If I add <clear/> to the top of that same block in the child web.config then I get:
"No http handler was found for request type 'GET'"
In your case you want to use remove (put it first)
<remove verb="POST,GET,HEAD" path="elmah.axd" />
Other Options:
If you can change your main app do the below.
<location path="." inheritInChildApplications="false">
<!-- settings -->
</location>
If you want to override what was inheritted, commonly you can use (example is a blurb from child web.config
<compilation debug="true">
<assemblies>
<clear/>
<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>
</compilation>
MSDN Guide on Web.Config inheritence.
I tried to install MSCharts on my Win2008 server.
It installed without problem.
Then I wrote
in config.
But when I'm trying to open page with charts it returned following error.
No http handler was found for request type 'GET'
Do you have any thougths about the problem?
This is what you need for ASP.NET 4.0 / IIS 7.5 on Windows 7:
Your web.config must contain the following:
<appSettings>
<add key="ChartImageHandler" value="storage=file;timeout=20;" />
</appSettings>
<compilation targetFramework="4.0">
<assemblies>
<add assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</assemblies>
</compilation>
<system.webServer>
<handlers>
<add name="ChartImg" verb="*" path="ChartImg.axd" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</handlers>
</system.webServer>
You also need this at the top of your aspx page:
<%# Register Assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
Namespace="System.Web.UI.DataVisualization.Charting" TagPrefix="asp" %>
Hope this helps
Like Danil said, IIS7 requires that you put the handlers in
<system.webserver>
<handlers>
Add the two lines below after the last add-in handles
<add name="ChartImg" verb="*" path="ChartImg.axd" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="ReportViewer" verb="*" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler,Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
Solution was in web config. IIS7 required to write handlers inside system.webserver but not in the system.web. So I just move handler and add name attribute as it became required.
Don't know anything about MSCharts, but I'd say try changing the AppPool for the app to 'Classic .NET AppPool'.
Alternatively, you may need to modify your web.config to add the handler in there. See Rick Strahl's post here.