Active Server Pages Programming (ASP)/event generation

Advertisement


Question
i 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.

Answer
Hi

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

Active Server Pages Programming (ASP)

All Answers


Answers by Expert:


Ask Experts

Volunteer


Srini Nagarajan

Expertise

I can answer any kind of questions in ASP.NET, C#, VB.NET, SharePoint 2007, ASP, Coldfusion, Powerbuilder 7.00 / 8.00, JAVA servlets, MS SQL 2000 / MSSQL7, Sybase

Experience

Contact me if you need any custom development on ASP.NET, ASP, SharePoint 2007, Coldfusion, Powerbuilder.

©2012 About.com, a part of The New York Times Company. All rights reserved.