|
-
Feb 19th, 2003, 07:03 AM
#1
Thread Starter
Frenzied Member
How to take action when selecting from dropdownlist
This might be a dumb question, but I am populating a dropdownlist with database values. And whenever someone is making a selection from that list I want the repeater on the page to be filled with something based on the value of the selected item in the dropdown. I DON'T want a button to be pressed when to refresh the repeater, I want this to be done as soon as the user selects something. I tried the selectedinsexchanged event and nothing happens...
kind regards
Henrik
-
Feb 19th, 2003, 09:17 AM
#2
Junior Member
You need to set "autopostback=true" so that when the selected index is changed it causes a postback to the server.
-
Feb 19th, 2003, 11:56 AM
#3
Thread Starter
Frenzied Member
Ok I have a BindGrid() method that to the following:
fill the dropdownlist and the repeater with data
that method is called in page_load with the condition
if(!IsPostback)
{
BindData();
}
the BindGrid makes select from the db and set databind for both the webcontrols.
Should I also use binddata in the event
private DropDownList_SelectedIndexChanged()
{
BindData();
}
Or how should I do it??? Note that Im using developer studio, so many changes can be done with the GUI
kind regards
Henrik
-
Feb 19th, 2003, 02:15 PM
#4
Frenzied Member
Also, set the autopostback property on the dropdownlist to true;
Dont gain the world and lose your soul
-
Feb 19th, 2003, 02:53 PM
#5
Junior Member
The way you are doing it looks just fine. That's how I would do it.
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
|