Active Server Pages Programming (ASP)/event generation
Expert: Srini Nagarajan - 3/9/2005
Questioni make a form(5 radiobuttonlist,6 dropdownlist etc. a large one) on which call function on each control through its event(onselectindexchanged).
but this form shows ambigious behavior as it starts refreshing at any control.
i check this with and without autopostback property true.
please suggest me which problem may exist and its solution also.
AnswerHi
Sorry for the delay in reply!
Mostly the autopostback will clear the selected event. Is the forms submits when radiobutton clicks? (use autopostback=true)
Here is the sample code to check
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As _
System.EventArgs) Handles Button1.Click
If RadioButton1.Checked Then
TextBox1.Text = "radio button 1 clicked"
ElseIf RadioButton2.Checked Then
TextBox1.Text = "radio button 2 clicked"
ElseIf RadioButton3.Checked Then
TextBox1.Text = "radio button 3 clicked"
End If
End Sub
Happy Programming!
-Srini