I have 53 checkboxes that I made into a control array. I am using this for part of a website url that i have stored as a string.
Each checkbox represents a number eg... check1(1) = 2 check3(3) = 6 so forth I already coded this part.
What I want to do is when the person click say checkbox(37) and clicks enter the Url String will be
www.website.com/destination=checkbox(37).php
I have it where only 1 checkbox can be clicked.
How would I do this? eg
Private Sub cmdClick()
URL = "www.website.com"
strDestination = "destination=" & What do I add here to make it use the checkbox checked?
Headers = Blah Blah Blah
inet.execute URL, "GET", strDestination, Headers
It probably possible to add 53 If Thens to get this to work but weren't control arrays to help you not do it that way and save time?
The one way to do this would be to set up a variable to hold the name of the last check box the was checked. Declare a variable in the Declarations area of your form and in the Click event of checkbox set the value of the variable to the name of the checkbox. Something like this:
Code:
Private Sub Check1_Click(Index As Integer)
lngLastChecked = Index
End Sub
Private Sub cmdClick()
URL = "www.website.com"
strDestination = "destination=checkbox(" & lngLastChecked & ").php"
Headers = ""
inet.execute URL, "GET", strDestination, Headers
End Sub
BTW, since you only want one checked at a time you might want to use OptionButtons instead..
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET. subscribe