|
-
Sep 18th, 2008, 02:25 PM
#1
Thread Starter
Fanatic Member
[Resolved] DropDownList property
Is there a porperty for the DropDownList that will allow code to be executed as soon as I select from the list without having to use a command button. I've tried using the SelectedIndexchanging and SelectedIndexChanged. Once user selects from list I need to programatically fill another DropDownList. Thank you.
Last edited by snufse; Sep 19th, 2008 at 07:18 AM.
-
Sep 18th, 2008, 02:32 PM
#2
Hyperactive Member
Re: DropDownList property
Change the AutoPostBack to be true and use the SelectedIndexChanged
-
Sep 18th, 2008, 03:47 PM
#3
Thread Starter
Fanatic Member
Re: DropDownList property
I have set the DropDownList property AutoPostBack = True and added
Code:
Protected Sub DropDownList1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DropDownList1.SelectedIndexChanged
ValidateInput()
If myError = False Then
BuildConnectString()
OpenConnection()
FillDropDownList()
CloseConnection()
End If
End Sub
Program does not hit the sub unless I use and click a button.
-
Sep 18th, 2008, 03:52 PM
#4
Hyperactive Member
Re: DropDownList property
what happens when you step through the code.. is myError set to true?
-
Sep 19th, 2008, 07:14 AM
#5
Thread Starter
Fanatic Member
Re: DropDownList property
When I select from DropDownList nothing happens. If I add a Button and click the button after selecting from DropDownList, then it hits the sub.
-
Sep 19th, 2008, 07:17 AM
#6
Thread Starter
Fanatic Member
Re: DropDownList property
Got it working as you said. My fault setting AutoPost = True on wrong DropDownList. Sorry, thank you for your help.
-
Sep 22nd, 2008, 05:05 AM
#7
Re: [Resolved] DropDownList property
You may also want to look at the CascadingDropDown controls in ASP.NET AJAX to avoid a postback
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
|