HTTP 403 Forbidden error During using MS Chart Control within SharePoint Visual Web Part

I found out an unexpected behavior during using MS Chart Control within a SharePoint Visual Web Part.where I got 403 forbidden error at the first time I tried to browse the page.

403 forbidden

But when I tried to refresh the page again, the error disappeared !

Cause:

This problem might occur because of the ChartImageHandler key was not configured properly with a correct “URL” attribute in web.config file.

Solution:

  • Open the “web.config” file of SharePoint web application that located in inetpub\wwwroot\wss\.
  • Press Ctrl + F to look for “ChartImageHandler”
  • Make sure that the URL value was assigned to the appropraute URL folder properly.
<appSettings>
<add key="ChartImageHandler"value="storage=memory;timeout=20;
 URL=/_layouts/Images/MicrosoftChartControls/" />
</appSettings>
  • Save the file.

Enjoy 🙂

See also, How to configure Web.Config to use MS Chart Control within SharePoint Visual Web Part.

Advertisements

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