I
itissandeep
I have a simple application that has a map. The user has to select two
sets from a single type of feature from the map. I use two radio
buttons under same GroupName for each set.
When the page loads for the first time, one radio button is checked
(obviously the other is unchecked). The user selects for one set and
checks the other radio button. Since, I have the AutoPostBack to be
true, the page loads again and the radio button for the second set is
checked. The state of the radio buttons is stored in session variables.
Everything is fine till now. Now starts the problem and struggle (!!).
With the second radio button checked, when I select any feature to add
to the second set, the selected features get added to the first set and
the radio button for the first set is checked and that for the second
set is unchecked on its own. I observed that this happens in the
Page_Load method only (Please refer to the code below). In other
methods the session variables are as intended
I have been struggling with this problem from many days. Can someone
please help ? Thank you very much
The code is the following:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim sMode As String
Dim iMode As Integer = 0
If Not Page.IsPostBack Then
RB1.Checked = Session("Checked1")
RB2.Checked = Session("Checked2")
Me.sUrl = CreateStreetMap(1)
End If
End Sub
Public Function CreateStreetMap(ByVal AMode As Integer) As String
....
....
....
Dim s1 As String
Dim s2 As String
If (RB1.Checked = True) Then
s1 = Request.QueryString("fieldname")
If Not s1 = "" Then
Session("Collection1") = _
Session("Collection1") & "," & s1
End If
End If
If (RB2.Checked = True) Then
s2 = Request.QueryString("fieldname")
If Not s2 = "" Then
Session("Collection2") = _
Session("Collection2") & "," & s2
End If
End If
TextBox1.Text = Session("Collection1")
TextBox2.Text = Session("Collection2")
....
....
....
End Function
Private Sub RB1_CheckedChanged(ByVal sender As Object, ByVal e As
System.EventArgs) Handles IncidentLinkRB.CheckedChanged
Session("Checked1") = RB1.Checked
Session("Checked2") = Not (RB2.Checked)
Session("checkChanged") = True
Me.sUrl = CreateStreetMap(1)
End Sub
Private Sub RB2_CheckedChanged(ByVal sender As Object, ByVal e As
System.EventArgs) Handles DetourLinkRB.CheckedChanged
Session("Checked1") = Not (RB2.Checked)
Session("Checked2") = RB2.Checked
Session("checkChanged") = True
Me.sUrl = CreateStreetMap(1)
End Sub
sets from a single type of feature from the map. I use two radio
buttons under same GroupName for each set.
When the page loads for the first time, one radio button is checked
(obviously the other is unchecked). The user selects for one set and
checks the other radio button. Since, I have the AutoPostBack to be
true, the page loads again and the radio button for the second set is
checked. The state of the radio buttons is stored in session variables.
Everything is fine till now. Now starts the problem and struggle (!!).
With the second radio button checked, when I select any feature to add
to the second set, the selected features get added to the first set and
the radio button for the first set is checked and that for the second
set is unchecked on its own. I observed that this happens in the
Page_Load method only (Please refer to the code below). In other
methods the session variables are as intended
I have been struggling with this problem from many days. Can someone
please help ? Thank you very much
The code is the following:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim sMode As String
Dim iMode As Integer = 0
If Not Page.IsPostBack Then
RB1.Checked = Session("Checked1")
RB2.Checked = Session("Checked2")
Me.sUrl = CreateStreetMap(1)
End If
End Sub
Public Function CreateStreetMap(ByVal AMode As Integer) As String
....
....
....
Dim s1 As String
Dim s2 As String
If (RB1.Checked = True) Then
s1 = Request.QueryString("fieldname")
If Not s1 = "" Then
Session("Collection1") = _
Session("Collection1") & "," & s1
End If
End If
If (RB2.Checked = True) Then
s2 = Request.QueryString("fieldname")
If Not s2 = "" Then
Session("Collection2") = _
Session("Collection2") & "," & s2
End If
End If
TextBox1.Text = Session("Collection1")
TextBox2.Text = Session("Collection2")
....
....
....
End Function
Private Sub RB1_CheckedChanged(ByVal sender As Object, ByVal e As
System.EventArgs) Handles IncidentLinkRB.CheckedChanged
Session("Checked1") = RB1.Checked
Session("Checked2") = Not (RB2.Checked)
Session("checkChanged") = True
Me.sUrl = CreateStreetMap(1)
End Sub
Private Sub RB2_CheckedChanged(ByVal sender As Object, ByVal e As
System.EventArgs) Handles DetourLinkRB.CheckedChanged
Session("Checked1") = Not (RB2.Checked)
Session("Checked2") = RB2.Checked
Session("checkChanged") = True
Me.sUrl = CreateStreetMap(1)
End Sub