Canned PieChart code dying

Joined
Sep 10, 2008
Messages
2
Reaction score
0
I found some code here which appears to be a very simple way to add a pie chart to an aspx page. The problem is that I can't even get the sample code to run and I'm not sure why -- something doesn't look right, but I don't know how to fix it ...

The sample is 2 files -- an ASPX and an ASCX and I've created the necessary "PieChartImages" subfolder:

I've attached the files. (Remove the .txt extension and change the extension accordingly.)

I get the following error
IIS Error said:
Server Error in '/' Application.
--------------------------------------------------------------------------------

Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS0246: The type or namespace name 'PieChart_ascx' could not be found (are you missing a using directive or an assembly reference?)

Source Error:



Line 14: ExamplePieChart.ImageHeight = 250;
Line 15:
Line 16: PieChart_ascx.PieChartElement myPieChartElement1 = new PieChart_ascx.PieChartElement();
Line 17: PieChart_ascx.PieChartElement myPieChartElement2 = new PieChart_ascx.PieChartElement();
Line 18: PieChart_ascx.PieChartElement myPieChartElement3 = new PieChart_ascx.PieChartElement();

HELP!!!!! I've emailed the original author, but I've been waiting a couple of days now and don't expect to hear from him at this point ...
 

Attachments

  • PieChart_ascx.txt
    7.1 KB · Views: 277
  • PieChartTest_aspx.txt
    1.6 KB · Views: 253
Joined
Nov 13, 2008
Messages
1
Reaction score
0
Are you still having this error?

I got around it by creating a new UserControl called PieChart2 with C# code behind. Then I copied the code from the <script ...> tag of the original UserControl, into a PieChart2 class. Lastly, reference the class via PieChart2 rather than PieChart_ascx.

Any questions, let me know.

brian
bluecomIT.com - Bringing IT and web solutions down to earth.
 
Joined
Sep 10, 2008
Messages
2
Reaction score
0
bcreeve said:
Are you still having this error?

I got around it by creating a new UserControl called PieChart2 with C# code behind. Then I copied the code from the <script ...> tag of the original UserControl, into a PieChart2 class. Lastly, reference the class via PieChart2 rather than PieChart_ascx.

Any questions, let me know.

brian
bluecomIT.com - Bringing IT and web solutions down to earth.

Actually I did -- the author finally did get back in touch with me:

Thanks – it was the Control ClassName tag that fixed it. Thanks so much for getting back to me and thanks so much for your work on this – it’s the perfect solution for my needs!


--------------------------------------------------------------------------------

Hi,

did you include the

Code:
<%@ Register TagPrefix="Stickler" TagName="PieChart" Src="PieChart.ascx" %>


Line on top of the page (of course with the right path to the PieChart.ascx control in the src parameter?


Maybe another cause could be the classname of the PieChartControl. Try to set the classname manually by adding the following line on top of the ascx file


Code:
<%@ Control Language="C#" ClassName="PieChart_ascx" %>


Hopefully this helps.
Best regards,
Björn
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top