Problem in ASP. NET Chart Control

Source: Internet
Author: User
1. About error:

The Type 'System. web. UI. datavisualization. charting. chart 'exists' in both 'C: \ windows \ Assembly \ gac_msil \ system. web. datavisualization \ 3.5.0.0 _ 31bf3856ad364e35 \ system. web. datavisualization. dll 'and 'C: \ windows \ Microsoft. net \ Assembly \ gac_msil \ system. web. datavisualization \ v4.0 _ 4.0.0.0 _ 31bf3856ad364e35 \ system. web. datavisualization. DLL

To resolve the problem, change all the 3.5.0.0 to 4.0.0.0 in webconfig.

 

2. can't show image, maybe you drag the chart control into page in 'source' model. aspx, change it to 'design' model, the webconfig will add node like below automatic.

 

<System. webserver>
<Handlers>
<Remove name = "chartimagehandler"/>
<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>

<Deleetask>
<Add key = "chartimagehandler" value = "Storage = file; timeout = 20; Dir = c: \ tempimagefiles \;"/>
</Appsettings>

 

Of course, you can also add it manual.

 

3. No permission for access tempimage folder.

If you use MS chart control on share hosting, normally, you don't have any permission outside your folder. at this time you need to remove all the folder setting regarding chart control, include 2 place:

A. webconfig: "/>

<Add key = "chartimagehandler" value = "Storage = file; timeout = 20;Dir = c: \ tempimagefiles \;

B. The page which is using chart control:

<Asp: Chart id = "chart1" runat = "server" palette = "brightpastel" backcolor = "# f3dfc1"

Imagetype = "PNG" Imagelocation = "C:/tempimagefiles/chartpic _ # seq )" Width = "800px"
Height = "500px" borderdashstyle = "solid" backgradientstyle = "topbottom" borderwidth = "2"
Bordercolor = "181, 64, 1">

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.