Dear members I am facing an issue
I am using chart control by Microsoft the issue is chart is displaying fine when hosted on local machine. But when I host it on deploy server chart doesn't come.
I had done all the possible changes available on internet spent almost 3-4 days on it at last have to write it over here please help.
I am pasting my web.config as well as my .aspx page for chart control over here..
Kindly help.. my web.config file
<?xml version="1.0"?>
<!--
Note: As an alternative to hand editing this file you can use the
web admin tool to configure settings for your application. Use
the Website->Asp.Net Configuration option in Visual Studio.
A full list of settings and comments can be found in
machine.config.comments usually located in
\Windows\Microsoft.Net\Framework\v2.x\Config
-->
<configuration>
<configSections>
<sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
<sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere"/>
<section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
<section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
<section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
</sectionGroup>
</sectionGroup>
</sectionGroup>
</configSections>
<appSettings>
<!--<add key="ChartImageHandler" value="Storage=file;Timeout=20;Url=Images"/>-->
<add key="ChartImageHandler" value="Storage=file;Timeout=20;Url=~/Images/;"/>
<!--<add key="ChartImageHandler" value="storage=file;timeout=20;dir=\\demotemp384\Images;" />-->
<!--<add key="ChartImageHandler" value="storage=file;timeout=20;dir=c:\TempDump\;" />-->
<!--<add key="ChartImageHandler" value="storage=file;timeout=20;dir=~/Images/ChartImages/" />-->
<!--<add key="ChartImageHandler" value="storage=file;timeout=20;"/>-->
<!--<add key="ChartImageHandler" value="storage=memory;timeout=120;privateimages=false"/>-->
<!--<add key="ChartImageHandler" value="storage=session;timeout=20;privateimages=false"/>-->
<!--<add key="ChartImageHandler" value="storage=memory;deleteAfterServicing=true;"/>-->
</appSettings>
<connectionStrings>
</connectionStrings>
<system.web>
<!--<httpCookies domain="String" httpOnlyCookies="true" requireSSL="false" />-->
<globalization uiCulture="en" culture="en-gb"/>
<anonymousIdentification enabled="true"/>
<sessionState mode="InProc" cookieless="false" timeout="15"/>
<httpRuntime maxRequestLength="15360" requestLengthDiskThreshold="15360"/>
<httpCookies httpOnlyCookies="true" lockItem="true"/>
<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.
Visual Basic options:
Set strict="true" to disallow all data type conversions
where data loss can occur.
Set explicit="true" to force declaration of all variables.
-->
<!--<roleManager enabled="true" />-->
<authorization>
<!--<allow roles="Admin" />-->
<deny users="?" />
</authorization>
<!--<authentication mode="Forms" />-->
<!--<authentication mode="Windows"></authentication>
<identity impersonate="false"></identity>-->
<compilation debug="true" strict="false" explicit="true">
<assemblies>
<!--<add assembly="CrystalDecisions.CrystalReports.Engine, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" />
<add assembly="CrystalDecisions.ReportSource, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" />
<add assembly="CrystalDecisions.Shared, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" />
<add assembly="CrystalDecisions.Web, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" />
<add assembly="CrystalDecisions.ReportAppServer.ClientDoc, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" />
<add assembly="CrystalDecisions.Enterprise.Framework, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" />
<add assembly="CrystalDecisions.Enterprise.InfoStore, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" />
<add assembly="Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />-->
<add assembly="System.Core, 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"/>
<add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Web.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<!--<add assembly="Microsoft.Office.Interop.Excel, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71E9BCE111E9429C"/>-->
</assemblies>
<buildProviders>
<!--<add extension=".rdlc" type="Microsoft.Reporting.RdlBuildProvider, Microsoft.ReportViewer.Common, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />-->
</buildProviders>
<!--<codeSubDirectories>
<add directoryName="CSFiles" />
</codeSubDirectories>-->
</compilation>
<pages enableEventValidation="false" validateRequest="true" viewStateEncryptionMode="Always"
maintainScrollPositionOnPostBack="true">
<namespaces>
<clear />
<add namespace="System" />
<add namespace="System.Collections" />
<add namespace="System.Collections.Specialized" />
<add namespace="System.Configuration" />
<add namespace="System.Text" />
<add namespace="System.Text.RegularExpressions" />
<add namespace="System.Web" />
<add namespace="System.Web.Caching" />
<add namespace="System.Web.SessionState" />
<add namespace="System.Web.Security" />
<add namespace="System.Web.Profile" />
<add namespace="System.Web.UI" />
<add namespace="System.Web.UI.WebControls" />
<add namespace="System.Web.UI.WebControls.WebParts" />
<add namespace="System.Web.UI.HtmlControls" />
</namespaces>
<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="ajaxToolkit" namespace="AjaxControlToolkit" assembly="AjaxControlToolkit" />
<add tagPrefix="asp" namespace="System.Web.UI.DataVisualization.Charting"
assembly="System.Web.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</controls>
</pages>
<customErrors mode="Off"/>
<!--<customErrors mode="RemoteOnly" defaultRedirect="ErrorHandler.aspx">
<error statusCode="403" redirect="ErrorHandler.aspx"/>
<error statusCode="404" redirect="ErrorHandler.aspx"/>
</customErrors>-->
<!--<sessionState mode="InProc" cookieless="false" timeout="15"></sessionState>-->
<!--
The <authentication> section enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
<!--
The <customErrors> section enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers to configure html error pages
to be displayed in place of a error stack trace.
<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
<error statusCode="403" redirect="NoAccess.htm" />
<error statusCode="404" redirect="FileNotFound.htm" />
</customErrors>
-->
<!--<httpHandlers>
<add verb="GET" path="CaptchaImage.axd"
type="MSCaptcha.CaptchaImageHandler, MSCaptcha" />
<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"/>
<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>
<remove path="*.asmx" verb="*" />
<add path="*.asmx" verb="*" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
validate="false" />
<add path="CaptchaImage.axd" verb="GET" type="MSCaptcha.CaptchaImageHandler, MSCaptcha" />
<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" />
<add path="*_AppService.axd" verb="*" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
validate="false" />
<add path="ScriptResource.axd" verb="GET,HEAD" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
validate="false" />
<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>
<httpModules>
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</httpModules>
</system.web>
<!--<location allowOverride="true" inheritInChildApplications="true">
<appSettings>
<add key="CrystalImageCleaner-AutoStart" value="true" />
<add key="CrystalImageCleaner-Sleep" value="60000" />
<add key="CrystalImageCleaner-Age" value="120000" />
</appSettings>
</location>-->
<system.codedom>
<compilers>
<compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CSharp.CSharpCodeProvider,System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" warningLevel="4">
<providerOption name="CompilerVersion" value="v3.5"/>
<providerOption name="WarnAsError" value="false"/>
</compiler>
<compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" warningLevel="4">
<providerOption name="CompilerVersion" value="v3.5"/>
<providerOption name="OptionInfer" value="true"/>
<providerOption name="WarnAsError" value="false"/>
</compiler>
</compilers>
</system.codedom>
<system.webServer>
<!--<security>
<requestFiltering>
<hiddenSegments>
<add segment="Javascript"/>
</hiddenSegments>
</requestFiltering>
</security>-->
<modules runAllManagedModulesForAllRequests="true" />
<directoryBrowse enabled="false" />
<validation validateIntegratedModeConfiguration="false" />
<modules>
<remove name="ScriptModule" />
<add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</modules>
<handlers>
<remove name="WebServiceHandlerFactory-Integrated" />
<remove name="ScriptHandlerFactory" />
<remove name="ScriptHandlerFactoryAppServices" />
<remove name="ScriptResource" />
<remove name="ChartImageHandler" />
<add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode"
type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd"
preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add name="ScriptResource" verb="GET,HEAD" path="ScriptResource.axd"
preCondition="integratedMode" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<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>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
my Chart.aspx code.
<%--<asp:Chart ID="Chart1" runat="server" ImageLocation="Images/1.png" ImageStorageMode="UseImageLocation" ImageType="Png"
Height="500px">
<Series>
<asp:Series ChartType="Pie" Name="Series1" Legend="Legend1" IsValueShownAsLabel="true">
</asp:Series>
</Series>
<ChartAreas>
<asp:ChartArea Name="ChartArea1">
</asp:ChartArea>
</ChartAreas>
<Legends>
<asp:Legend Name="Legend1" Docking="Bottom" LegendStyle="Column">
</asp:Legend>
</Legends>
</asp:Chart>--%>
<%--<asp:Chart ID="Chart1" runat="server" ImageLocation="\\demotemp384\Images\1.png" ImageStorageMode="UseImageLocation" ImageType="Png"
Height="500px">
<Series>
<asp:Series ChartType="Pie" Name="Series1" Legend="Legend1" IsValueShownAsLabel="true">
</asp:Series>
</Series>
<ChartAreas>
<asp:ChartArea Name="ChartArea1">
</asp:ChartArea>
</ChartAreas>
<Legends>
<asp:Legend Name="Legend1" Docking="Bottom" LegendStyle="Column">
</asp:Legend>
</Legends>
</asp:Chart>--%>
<asp:Chart ID="Chart1" runat="server" ImageLocation="~/Images/1.png" ImageStorageMode="UseImageLocation" ImageType="Png"
Height="500px">
<Series>
<asp:Series ChartType="Pie" Name="Series1" Legend="Legend1" IsValueShownAsLabel="true">
</asp:Series>
</Series>
<ChartAreas>
<asp:ChartArea Name="ChartArea1">
</asp:ChartArea>
</ChartAreas>
<Legends>
<asp:Legend Name="Legend1" Docking="Bottom" LegendStyle="Column">
</asp:Legend>
</Legends>
</asp:Chart>
<%--<asp:Chart ID="Chart1" runat="server" ImageLocation="~/1.png" ImageStorageMode="UseImageLocation" ImageType="Png"
Height="500px">
<%--<asp:Chart ID="Chart1" runat="server" ImageStorageMode="UseImageLocation" ImageType="Png"
Height="500px">
<Series>
<asp:Series ChartType="Pie" Name="Series1" Legend="Legend1" IsValueShownAsLabel="true">
</asp:Series>
</Series>
<ChartAreas>
<asp:ChartArea Name="ChartArea1">
</asp:ChartArea>
</ChartAreas>
<Legends>
<asp:Legend Name="Legend1" Docking="Bottom" LegendStyle="Column">
</asp:Legend>
</Legends>
</asp:Chart>--%>
</td>
<td align="center">
<%--<asp:Chart ID="Chart2" runat="server" ImageLocation="Images/2.png" ImageStorageMode="UseImageLocation" ImageType="Png"
Height="500px">
<Series>
<asp:Series ChartType="Pie" Name="Series1" XValueMember="CompHeadName" YValueMembers="Expenditure"
Legend="Legend1" IsValueShownAsLabel="true">
</asp:Series>
</Series>
<ChartAreas>
<asp:ChartArea Name="ChartArea1">
</asp:ChartArea>
</ChartAreas>
<Legends>
<asp:Legend Name="Legend1" Docking="Bottom" LegendStyle="Column">
</asp:Legend>
</Legends>
</asp:Chart>--%>
<%--<asp:Chart ID="Chart2" runat="server" ImageLocation="\\demotemp384\Images\2.png" ImageStorageMode="UseImageLocation" ImageType="Png"
Height="500px">
<Series>
<asp:Series ChartType="Pie" Name="Series1" XValueMember="CompHeadName" YValueMembers="Expenditure"
Legend="Legend1" IsValueShownAsLabel="true">
</asp:Series>
</Series>
<ChartAreas>
<asp:ChartArea Name="ChartArea1">
</asp:ChartArea>
</ChartAreas>
<Legends>
<asp:Legend Name="Legend1" Docking="Bottom" LegendStyle="Column">
</asp:Legend>
</Legends>
</asp:Chart>--%>
<asp:Chart ID="Chart2" runat="server" ImageLocation="~/Images/2.png" ImageStorageMode="UseImageLocation" ImageType="Png"
Height="500px">
<Series>
<asp:Series ChartType="Pie" Name="Series1" XValueMember="CompHeadName" YValueMembers="Expenditure"
Legend="Legend1" IsValueShownAsLabel="true">
</asp:Series>
</Series>
<ChartAreas>
<asp:ChartArea Name="ChartArea1">
</asp:ChartArea>
</ChartAreas>
<Legends>
<asp:Legend Name="Legend1" Docking="Bottom" LegendStyle="Column">
</asp:Legend>
</Legends>
</asp:Chart>
<%--<asp:Chart ID="Chart2" runat="server" ImageLocation="~/2.png" ImageStorageMode="UseImageLocation" ImageType="Png"
Height="500px">
<Series>
<asp:Series ChartType="Pie" Name="Series1" XValueMember="CompHeadName" YValueMembers="Expenditure"
Legend="Legend1" IsValueShownAsLabel="true">
</asp:Series>
</Series>
<ChartAreas>
<asp:ChartArea Name="ChartArea1">
</asp:ChartArea>
</ChartAreas>
<Legends>
<asp:Legend Name="Legend1" Docking="Bottom" LegendStyle="Column">
</asp:Legend>
</Legends>
</asp:Chart>--%>
</td>
</tr>
<tr>
<td colspan="2" align="center">
<asp:Chart ID="Chart3" runat="server" ImageLocation="~/Images/3.png" ImageStorageMode="UseImageLocation"
Height="500px" Width="500px">
<Legends>
<asp:Legend Name="Legend1">
</asp:Legend>
</Legends>
<Series>
<asp:Series Name="Series1" Legend="Legend1" LegendText="Budget">
</asp:Series>
<asp:Series Name="Series2" XValueMember="CompHeadName" YValueMembers="Expenditure"
Legend="Legend1" LegendText="Expenditure">
</asp:Series>
</Series>
<ChartAreas>
<asp:ChartArea Name="ChartArea1">
</asp:ChartArea>
</ChartAreas>
</asp:Chart>
I had the same problem. For my ASP.NET application running on a VPS, I used a domain name relocation service in 'Frame' mode to replace the ugly IP address with an elegant site name. I verified that the graph was produced in the c:\\Temp directory specified in web.config, but somehow the ChartImageHander was denied permission to load it using IE. Chrome proved to be more tolerant. The thing is: the graph DID get displayed when the site was approached using the raw IP-address, but NOT when using the domain name. Running the domain name relocation service in '301' mode solved the problem, but unfortunately, the ugly IP address is now visible again in the browser...
Hope this helps.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.