如何在不安装图表控件的情况下在应用程序中使用它?

发布于 2024-08-02 08:44:29 字数 363 浏览 2 评论 0原文

我正在使用一个网络应用程序,其中有一个图表控件。我已经安装了 Microsoft 图表控件 exe 和 Visual studio 插件。

问题是,当我在服务器上上传应用程序时,两个程序集缺少 System.Web.DataVisualization.Design.dllSystem.Web.DataVisualization.dll< /代码>。

所以,我想卸载Microsoft图表控件exe &添加 Visual Studio,而仅通过在应用程序中提供引用来使用 DLL。

现在,如何在 ASPX 页面上定义图表控件?如何在 ASPX 页面上注册程序集以及如何从中获取图表控件?

I am using a web application in which there is a chart control. I had installed the Microsoft chart control exe and Visual studio add on.

The problem is that when I upload the application on the server, there is a problem with the two assemblies missing System.Web.DataVisualization.Design.dll and System.Web.DataVisualization.dll.

So, I want to uninstall the Microsoft chart control exe & Visual studio add on, and instead only use the DLL in the application by giving reference in it.

Now, how do I define chart control on an ASPX page? How do I register the assemblies on the ASPX page and how can I get the chart control from it?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

违心° 2024-08-09 08:44:29

我认为你可以将 DLL 添加到网站的 Bin 目录中。

在本地安装图表控件只是将 DLL 添加到计算机的某个位置(我认为)。我相信Add-In是为了给你设计模式提供支持。它不会安装任何特定于您的项目的内容。

但是,您可能需要在页面上或 web.config 中注册控件。例如,以下是 web.config 中 AjaxControlToolkit 控件的注册:

<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
  <system.web>
    <pages>
      <controls>
        <add tagPrefix="ajaxToolkit" namespace="AjaxControlToolkit" assembly="AjaxControlToolkit"/>
      </controls>
    </pages>
  </system.web>
</configuration>

I think you can just add the DLL's to your Bin directory of your website.

Installing the chart controls locally simply adds the DLL's to your computer somewhere (I think). And I believe that the Add-In is to give you support for design mode. It doesn't install anything specific to your projects.

However, you may need to register the controls either on the page or in the web.config. For example, here is the registration of the AjaxControlToolkit controls in the web.config:

<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
  <system.web>
    <pages>
      <controls>
        <add tagPrefix="ajaxToolkit" namespace="AjaxControlToolkit" assembly="AjaxControlToolkit"/>
      </controls>
    </pages>
  </system.web>
</configuration>
尬尬 2024-08-09 08:44:29

我已经解决了这个问题。

首先,添加库 System.Web.DataVisualization.dll 作为参考。

然后,在 web.config 中的 中添加以下行,

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

您可能会看到红色的 DataVisualization.Charting.ChartHttpHandler,它将成功构建并运行。这可能是 ReSharper 的错误。

I have solved the problem.

First, add the library System.Web.DataVisualization.dll as reference.

Then, add the following line in web.config, inside <httpHandlers>

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

You may see DataVisualization.Charting.ChartHttpHandler in red, it will build and run successfully. This may be a ReSharper bug.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文