[英]Microsoft Chart control not working on hosted server but working fine on local iis
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. 我正在使用Microsoft的图表控件,问题是在本地计算机上托管时图表显示正常。 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. 我花了将近3-4天的时间完成了互联网上所有可用的更改,最后不得不在这里写下来,请帮助。
I am pasting my web.config as well as my .aspx page for chart control over here.. 我正在粘贴我的web.config以及我的.aspx页面,以在此处进行图表控制。
Kindly help.. my web.config file 请帮助..我的web.config文件
<?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. 我的Chart.aspx代码。
<%--<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.
对于在VPS上运行的ASP.NET应用程序,我使用了“框架”模式下的域名重定位服务,以优雅的站点名称替换了难看的IP地址。 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.
我验证了该图是在web.config中指定的c:\\ Temp目录中生成的,但是以某种方式拒绝了ChartImageHander使用IE加载该图的权限。 Chrome proved to be more tolerant.
事实证明,Chrome更能容忍。 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.
问题是:使用原始IP地址访问站点时显示图形DID,但使用域名时不显示图形DID。 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...
以“ 301”模式运行域名重定位服务已解决了该问题,但不幸的是,丑陋的IP地址现在在浏览器中再次可见...
Hope this helps. 希望这可以帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.