No http handler was found for request type ‘GET’ in SharePoint Visual WebPart

I tried to use Asp.Net Chart control within SharePoint Visual WebPart, After I deployed the SharePoint Solution, I tried to add Chart visual webpart to SharePoint page, I got the following server error.

No http handler was found for request type 'GET'

Chart Configuration

Cause:

This problem usually occurs because of The web.config was not configured successfully to use Chart control.

Solution:

Thence, to configure the web.config for Chart control, follow the simple steps below:

  • Open web.config file of SharePoint web application that located in
    • C:\inetpub\wwwroot\wss\VirtualDirectories\"Port of web application"

Web.config

  • Within <httpHandlers> tag, add the following:

<httpHandlers>
<add path="ChartImg.axd" verb="GET,HEAD,POST" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false" />
</httpHandlers>

httpHandlers

  • Within <controls> tag, add the following:

<controls>
<add tagPrefix="asp" namespace="System.Web.UI.DataVisualization.Charting" assembly="System.Web.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</controls>

Controlforchart

  • Within <handlers> tag, add 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=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</handlers>

Handlerforchart

  • Within <appSettings> tag, add the following:

<appSettings>
<add key="ChartImageHandler" value="storage=file;timeout=20;dir=c:\TempImageFiles\;" />
</appSettings>

appsettingforchart

Note:  you should have a folder called “TempImageFiles” in C:\ Drive.ShareingTempImages

  • Also, it should be shared as Read & Write permission for everyone .

SecurityTempImages

  • Try to deploy the SharePoint solution again, and browse your site.The Chart control is now working properly.

Scurve

Be aware that,

  • If you have a SharePoint Farm with 6 servers where 2 for DB and 4 for WFE\APP. therefore ,you must repeat all the previous steps in all 4 WFE\APP servers web.config file.

Keep in mind,

  • This configuration is not only for SharePoint Solution, you can also use it with Asp.Net Solution.

Enjoy 🙂

Advertisements

4 thoughts on “No http handler was found for request type ‘GET’ in SharePoint Visual WebPart

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s