Chart Control needs an HTTP Handler? - asp.net

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>

Related

Web Form charts: No http handler was found for request type 'GET'

I'm getting this error: No http handler was found for request type 'GET'. I figure the reason is with an incorrect web.config, as suggested in the answer to another question. However, following these suggestions doesn't solve my problem completely. Now I'm getting a 500- Internal server error, or 404- Resource *.aspx is not found (this error is indeterminate, 500 at one point and 404 at another). This error only exists after I've deployed to a DEV server. The application runs fine in DEBUG mode.
Here's my config file.
<configuration>
<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
<defaultDocument>
<files>
<add value="main.aspx" />
</files>
</defaultDocument>
<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>
<system.web>
<customErrors mode="Off"/>
<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>
<compilation debug="true" targetFramework="4.5">
<assemblies>
<add assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</assemblies>
</compilation>
<httpRuntime targetFramework="4.5" />
</system.web>
<appSettings>
<add key="ChartImageHandler" value="storage=file;timeout=20;dir=c:\TempImageFiles\;" />
</appSettings>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" />
</startup>
</configuration>
I also added this tag to my .aspx page:
<%# Register Assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
Namespace="System.Web.UI.DataVisualization.Charting" TagPrefix="asp" %>
The solution is this
in web.conf add
<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
<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>
and add
<appSettings>
<add key="ChartImageHandler" value="storage=file;timeout=20;dir=C:\inetpub\wwwroot\temp\;" />
</appSettings>
change the dir to a folder of your choice

Configure ASP.net 4.5 for Charting

I need a way to configure ASP.net 4.5 for Charting.
Error in line:
<assemblies>
<add assembly="System.Web.DataVisualization, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</assemblies>
Error code:
Could not load file or assembly 'System.Web.DataVisualization, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies.
web.config
<configuration>
<appSettings>
<add key="ChartImageHandler" value="storage=memory;timeout=30;" />
</appSettings>
<system.web>
<httpHandlers>
<add path="ChartImg.axd" verb="GET,HEAD" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=4.5.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.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</controls>
</pages>
<compilation debug="true" strict="false" explicit="true" targetFramework="4.0" >
<assemblies>
<add assembly="System.Web.DataVisualization, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</assemblies>
</compilation>
</system.web>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
<validation validateIntegratedModeConfiguration="false" />
<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.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</handlers>
</system.webServer>
</configuration>
Charting comes built in to ASP.NET 4+. Unfortunately, there are still some glitches with adding it to projects. The easiest way I found to add charts was to actually drag the item out of the Toolbox into an aspx page. It did some background operations to the Web.config file and the page I added the control to.
Here's what it added to the Web.config file:
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.5">
<assemblies>
<add assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</assemblies>
</compilation>
</system.web>
</configuration>
Here's what it added to the aspx file to which I added the control:
<%# Register Assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Namespace="System.Web.UI.DataVisualization.Charting" TagPrefix="asp" %>
Unfortunately, it still did not work as is. I had to make a couple more adjustments to the Web.config file:
<configuration>
<appSettings>
<add key="ChartImageHandler" value="storage=memory;timeout=20;" />
</appSettings>
<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>
Abandoned. Went the flot with AJAX option.

Page Server Error in '\' application

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>

Could not load file or assembly 'System.Web.Extensions, Version=1.0.61025.0 Error [closed]

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.
Closed 11 years ago.
I have check this site for solutions but i didn't find something that can help me..
My Host Diabled the Custom Error on their Server, So now i can see the real errors.
My web site was working flawless in the old Host, But now i Moved to a new host
Please pay attention: The Old host was a VPS on NetVison host
So i'v stoped paying him and now i'm hosting on the same NetVision host as a shared host.
So I moved all the files in to the root folder and config the SQL details in the Web.config
I can't load the site for some reason.
i got Errors all the time.
PLEASE HELP ME!
The Error I get:
Server Error in '/' Application.
Configuration Error
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.
Source Error:
Line 49: <assemblies>
Line 50: <add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
Line 51: <add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>*
Line 52: </assemblies>
Line 53: </compilation>
Source File:
\filer\Sites\NV355601\www.picit.co.il\www\web.config Line: 51
MY Web.Config:
<?xml version="1.0"?>
<configuration>
<appSettings>
<add key="SiteAddress" value="http://www.picit.co.il/" />
<add key="SSLSiteAddress" value="https://bonsite-secure.co.il/picit/" />
<add key="EMAIL_HOST" value="mail.barak.net.il"/>
<add key="EMAIL_CONTACT_NAME" value="PicIt"/>
<add key="EMAIL_USER" value="bonsite-barak.net.il"/>
<add key="EMAIL_PASS" value="013013"/>
<add key="MASTER_USERNAME" value="bonsite"/>
<add key="MASTER_PASSWORD" value="master123#"/>
<add key="FCKeditor:UserFilesPath" value="~/Up/Main/"/>
<add key="FCKeditor:BasePath" value="~/Controls/FCKeditor/"/>
</appSettings>
<connectionStrings>
<add name="Con" connectionString="Data Source=127.0.0.1;Initial Catalog=db;user=usr;password=pwd;" providerName="System.Data.SqlClient"/>
</connectionStrings>
<system.web>
<globalization culture="he-IL" uiCulture="he-IL"/>
<sessionState mode="InProc"/>
<customErrors mode="Off"/>
<identity impersonate="true"/>
<authentication mode="Windows"/>
<httpRuntime maxRequestLength="22000"
minFreeThreads="16"
executionTimeout="500"
useFullyQualifiedRedirectUrl="false"
minLocalRequestFreeThreads="4"
appRequestQueueLimit="1000" />
<pages theme="Front">
<namespaces>
<add namespace="Website"/>
</namespaces>
<controls>
<add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" namespace="System.Web.UI" tagPrefix="asp"/>
<add tagPrefix="Upload" namespace="Brettle.Web.NeatUpload" assembly="Brettle.Web.NeatUpload"/>
<add tagPrefix="fck" namespace="FredCK.FCKeditorV2" assembly="FredCK.FCKeditorV2"/>
<add tagPrefix="swf" tagName="movie" src="~/Controls/swf.ascx"/>
<add tagPrefix="Btn" tagName="Friend" src="~/Controls/btn_friend.ascx"/>
<add assembly="Bound" namespace="CustomControls" tagPrefix="asp"/>
<add assembly="skmValidators" namespace="skmValidators" tagPrefix="Vld"/>
<add tagPrefix="CC" tagName="Upload" src="~/Controls/upload.ascx"/>
</controls>
</pages>
<compilation debug="true">
<assemblies>
<add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</assemblies>
</compilation>
<httpModules>
<add name="UploadHttpModule" type="Brettle.Web.NeatUpload.UploadHttpModule, Brettle.Web.NeatUpload"/>
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</httpModules>
<httpHandlers>
<remove verb="*" path="*.asmx"/>
<add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>
<add verb="GET" path="ScriptResource.axd" type="Microsoft.Web.Handlers.ScriptResourceHandler" validate="false"/>
</httpHandlers>
</system.web>
<system.webServer>
<modules>
<add name="UploadHttpModule" type="Brettle.Web.NeatUpload.UploadHttpModule, Brettle.Web.NeatUpload" preCondition="managedHandler"/>
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" preCondition="managedHandler"/>
</modules>
<handlers>
<add name="ScriptResource.axd_GET" path="ScriptResource.axd" verb="GET" type="Microsoft.Web.Handlers.ScriptResourceHandler" preCondition="integratedMode,runtimeVersionv2.0"/>
<add name="ScriptResource.axd_GET,HEAD" path="ScriptResource.axd" verb="GET,HEAD" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" preCondition="integratedMode,runtimeVersionv2.0"/>
<add name="*.asmx_*" path="*.asmx" verb="*" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" preCondition="integratedMode,runtimeVersionv2.0"/>
</handlers>
<validation validateIntegratedModeConfiguration="false"/>
</system.webServer>
</configuration>
Thanks ALL FOR YOUR HELP!
Install Ajax Extensions 1.0 from Microsoft Download Center
I have faced this error most of time due to this not being installed.
You have to ask to your host for ASP.NET 3.5 framework support.

DateTimePicker control install error

I have a question about a third-party DateTimePicker control.
I've downloaded the dll and paste the appropriate web.config lines.
I've put the control into the aspx page. When I load the page an alertbox appears:
No «add verb="GET" path="/JavascriptDateTimeFormat.axd" /» httpHandler.
The control's textbox and the buttons are present but does nothing.
Part of my web.config is:
<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" />
<add tagPrefix="mark" assembly="Mark.Web.UI.WebControls.DateTimePicker" namespace="Mark.Web.UI.WebControls"/>
</controls>
</pages>
<httpHandlers>
<remove verb="*" path="*.asmx" />
<add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add verb="GET,HEAD" path="ScriptResource.axd" validate="false" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add verb="GET" path="/helpdeskweb/JavascriptDateTimeFormat.axd" type="Mark.Web.UI.JavascriptDateTimeFormat, Mark.Web.UI.WebControls.DateTimePicker"/>
</httpHandlers>
What should I do?
Just omit the name="JavascriptDateTimeFormat" and everything should work. The added line in IIS7 is:
<add verb="GET" path="JavascriptDateTimeFormat.axd"
type="Mark.Web.UI.JavascriptDateTimeFormat, Mark.Web.UI.WebControls.DateTimePicker"/>
Alexander
If this is for IIS7, you need to change it slightly. In this case, you need to put the following line in the section of the subsection:
<add name="JavascriptDateTimeFormat" verb="GET" path="JavascriptDateTimeFormat.axd" type="Mark.Web.UI.JavascriptDateTimeFormat, Mark.Web.UI.WebControls.DateTimePicker"/>
It's nearly the same, but the syntax and location is slightly different.
He didn't specify, but you need to put it in the
<handlers>
This is the complete solution to this problem.
It's best to have sections for IIS6 AND IIS 7:
<configuration>
<system.webServer>
<handlers>
<add name="JavascriptDateTimeFormat" verb="GET" path="JavascriptDateTimeFormat.axd" type="Mark.Web.UI.JavascriptDateTimeFormat, Mark.Web.UI.WebControls.DateTimePicker"/>
</handlers>
</system.webServer>
<system.web>
<httpHandlers>
<add verb="GET" path="/JavascriptDateTimeFormat.axd" type="Mark.Web.UI.JavascriptDateTimeFormat, Mark.Web.UI.WebControls.DateTimePicker"/>
</httpHandlers>
</system.web>
</configuration>
Add this entry into web.config between HttpHandlers tag
add verb="GET" path="JavascriptDateTimeFormat.axd" type="Mark.Web.UI.JavascriptDateTimeFormat, Mark.Web.UI.WebControls.DateTimePicker"
make sure the path is as mention in bold.

Resources