Click here to Skip to main content
15,890,407 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I am currently working on an asp.net page that I want the users to check some checkboxes and as the users check the check boxes I would like a pie chart that would update on a button click. For example..

C#
if (checkbox1.checked = true)
{
 piechart1 = 10%;
}


i'm sure that this is not how this is done but just so you get the idea.

I am pretty new to both charts and asp.net so any help is appreciated. Thanks!
Posted

1 solution

Can I unsee it?! :-)

Suppose you wanted to say if (checkbox1.checked == true) { /* ... */ } and mixed up '==' (check for equality) with '=' (assignment) and lost the upper-case in "Checked" ("checked" would not compile). It happens. But isn't it obvious that if (checkbox1.checked == true) { /* ... */ } should be if (checkbox1.Checked) { /* ... */ }, because CheckBox.Checked is already Boolean; there is no need to compare it the true?

This is not even a bug. This is the indication of what you are doing, programming, or just wasting your time.

It cannot be the idea of anything. Listen to a good advice: stop working with charts or anything, stop ASP.NET development or whatever else you are doing. You can use your time much better. Learn programming, from the very beginning: types and instances, variables and members, operators; do simple exercises, better with simple console-only application. This is what you really need right now. ASP.NET, graphics, UI — it all needs OOP, but you are not even close. Don't rush, because, right now, doing all that, you will stay frustrated, won't go anywhere. Until you learn the very basics.

—SA
 
Share this answer
 

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