Click here to Skip to main content
15,892,674 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello all,

Am using chart MS chart control in my ASP.net project.Its giving me the output in the form of chart as i need it.But now i want to store that chart image some where in project directory.So i followed the following procedure in my .aspx page:

<asp:Chart ID="Chart3" runat="server" Height="25px" Palette="None" Width="150px" ImageLocation="D:\Yogesh Experiment\proSES_Solution_28_Jan_2011\ChartImages\Sparkline" ImageStorageMode="UseImageLocation" ImageType="Jpeg">

To store the chart image.

I also include following line in my web.config file.

<add key="ChartImageHandler" value="storage=memory;deleteAfterServicing=false;">



But image is not stored in directory.Instead of that it gives me an following error:

'D:\Yogesh Experiment\proSES_Solution_28_Jan_2011\ChartImages\Sparkline.jpeg' is not a valid virtual path.


Can anybody help me solve the problem.


Thanks & Regards
Yogesh
Posted
Updated 7-Aug-11 22:37pm
v3

1 solution

Of course this path is not valid. Web works with paths relative to the site root directory which is mapped onto URL with domain name without sub-directories. Every absolute path written starting with URL schema and domain name is mapped to the file system absolute path depending on the root path. Relative path is relative to the location of the referring page.

This is explained here: http://msdn.microsoft.com/en-us/library/ms178116.aspx[^].

As to the absolute path in terms of server-local file systems, such paths are not accessible by the HTTP server at all.

—SA
 
Share this answer
 
Comments
YOGESH DHAGE 9-Aug-11 5:10am    
Thanks Buddy its works :-)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900