Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Need to be able for buttons to keep track of each other

Reply
Thread Tools

Need to be able for buttons to keep track of each other

 
 
bob
Guest
Posts: n/a
 
      05-03-2004
I am just getting into web programming. I am using VB ASP.NET. I have
multiple buttons on my form.
When a person clicks on one of imgagebuttons, I want a accumulated counter
for each time a button is clicked, and when 2 different imagebuttons are
clicked, I want them compared to see if the images are the same, how do I do
this? I tried making the variables public, but I think I am having problems
with viewstate in which I am not using besides the property being true.

TIA
..
Here the code behind one of the buttons:

ncount += 1 'this is suppose to count how many buttons are pushed.

If ncount < 3 Then

ImageButton2.ImageUrl = newimage

Select Case ncount

Case 1

b(1) = ImageButton2.ImageUrl

Case 2

b(2) = ImageButton2.ImageUrl

ncount = 0 ' reset the count because only 1 or 2 buttons_

'be pushed at 1 time.

If b(1) = b(2) Then

'Messagebox("Correct")

correct += 1

lblNumberCorrect.Text = Str(correct)

lblifCorrect.Text = "Correct"

Else

incorrect += 1

lblNumberIncorrect.text = Str(incorrect)

lblifcorrect.Text = "InCorrect"

End If

ncount = 0

End Select

End If


 
Reply With Quote
 
 
 
 
Aaron Bertrand [MVP]
Guest
Posts: n/a
 
      05-03-2004
>I am just getting into web programming. I am using VB ASP.NET.

This newsgroup is for classic ASP. Please see a .NET newsgroup. They have
"dotnet" in their name.

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Not able to display color in excel not able to display color in excel using xml sed_y XML 0 02-15-2012 09:46 PM
insert track reference in mp3 track D@Z Computer Support 1 05-02-2008 03:32 PM
Old certification track vs new certification track. Barkley Hughes MCAD 5 11-12-2006 02:41 PM
Need to be able for buttons to keep track of each other bob ASP .Net 1 05-03-2004 05:17 AM
.NET able to track file download success? Melissa Mussitsch ASP .Net Web Controls 1 02-19-2004 02:57 PM



Advertisments