Click to See Complete Forum and Search --> : An interesting Error


Nate1
11-03-2007, 05:53 PM
I have a reservation process which will allows a User to select a area before moving on.

If they select no area it will produce an error message else it will send the selected are to the URL

response.redirect(page.aspx?opts=31,32)

then the user moves on to the next page, on the next page if they want to change the selected area they can go back, based on the URL parameters Ive set the page so that the previous areas are selected.
Problem is when I move forward again the selected options are all included even if they are changed to unselected.

Code: Page Load


' == On page load set these options to checked if selected ==

For I = 0 To UBound(AllOptions)
Dim j As Integer = Trim$(AllOptions(I))

Select Case j
Case 11
qtr11.Checked = True
Case 12
qtr12.Checked = True
Case 13
qtr13.Checked = True
Case 14
qtr14.Checked = True

...

end select
Next


Code Next Page selection

' ====== Option 1 ======
If qtr11.Checked Then
Optionstr = "11"
End If

If qtr12.Checked And Optionstr = "" Then
Optionstr = "12"
ElseIf qtr12.Checked Then
Optionstr = Optionstr + ",12"
End If

If qtr13.Checked And Optionstr = "" Then
Optionstr = "13"
ElseIf qtr13.Checked Then
Optionstr = Optionstr + ",13"
End If

If qtr14.Checked And Optionstr = "" Then
Optionstr = "14"
ElseIf qtr14.Checked Then
Optionstr = Optionstr + ",14"
End If


' ====== Option 2 ======
If qtr21.Checked And Optionstr = "" Then
Optionstr = "21"
ElseIf qtr21.Checked Then
Optionstr = Optionstr + ",21"
End If

....

'Eventually creates a response.redirect with the attached parameter



The checked items are showing up checked when they actually aren't because of the page load events, How do I stop this happening, I don't want to remove the current selection not very User Friendly.