亲爱的成员我正面临一个问题
我正在使用Microsoft的图表控件,问题是图表在本地计算机上托管时显示正常。但是当我在部署服务器上托管它时,图表不会出现。
我已经完成了互联网上所有可能的变化,花了差不多3-4天才终于写完了这里请帮忙。
我正在粘贴我的web.config以及我的.aspx页面以进行图表控制。
请帮忙.. 我的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>
我的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>
答案 0 :(得分:0)
我遇到了同样的问题。对于在VPS上运行的ASP.NET应用程序,我在“帧”模式下使用域名重定位服务,用优雅的站点名称替换丑陋的IP地址。我验证了该图是在web.config中指定的c:\ Temp目录中生成的,但不知何故,ChartImageHander被拒绝使用IE加载它的权限。 Chrome被证明更加宽容。问题是:使用原始IP地址接近站点时显示图表DID,但是在使用域名时不显示。以“301”模式运行域名重定位服务解决了这个问题,但不幸的是,丑陋的IP地址现在再次在浏览器中可见...
希望这有帮助。