|
-
Mar 22nd, 2002, 11:12 AM
#1
Thread Starter
New Member
drop down list event
I'm eveloping a web application (survey) that has a drop down list and a command button. Right now, the user has to make a selection from the list and then hit the command button to fire off the next event. I would like to get rid of the command button altogether. Is there a method for the drop down list that can take the place of the command button_click sub??
It does not seem to work for me to put my VB code in the _SelectedIndexChanged method of the drop down list.
Thanks
Geno
-
Mar 22nd, 2002, 12:28 PM
#2
Fanatic Member
In the dropdown list add the following attribute:
Code:
autopostback="true"
Then in your Codebehind, any code not to run on events, put in the following:
Code:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If (Not Page.IsPostBack) Then
'This block will not run on events
End If 'IsPostBack
End Sub
Private Sub DropDownList1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DropDownList1.SelectedIndexChanged
'This block will run on _SelectedIndexChanged Event
End Sub
-
Mar 22nd, 2002, 03:10 PM
#3
Thread Starter
New Member
Thanks!!
That works really well!! Thanks!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|