I would like to have two dropdown lists.. both get their info from database (I can already do this) and one feeds the other a parameter. So, on ddlist1, I have chosen x and x is fed to ddlist2 as a parameter and its list is filled in. Now, here is my problem... I want to then make a selection on ddlist 2 and feed it as a parameter to either a 3rd ddlist or maybe a datagrid. Each time I choose the second ddlist option, it does not post back to the page. i have changed the autopostback to true and false and tried to use a submit button instead, but no luck. If anyone can tell me what to do or BETTER YET, where I can find info on this, I would appreciate it.mayb you're working offline when posting back the first time... <BR>(u didn't put the autopostback on false when selecting something of the first, did you
<BR>that's all i can think of..I'm not sure what you are saying about being offline.<BR>As for the autopostback, no I never indicated a false in the autopostback.I believe AutoPostBack defaults to False. If you explicitly make this value True and add a SelectedIndexChanged event to the DropDownList you will be able to perform the logic you desire within that event.After repeatedly testing this and trying various things, I have come to this conclusion. After making a selection in dropdownlist1 and passing that value to a parameterized query (with the autopostback set to true) and having the second dropdownlist being filled with the correct options... once I try to make a selection in the second dropdownlist and try to somehow capture that information, it does not work.. I suspect due to the ispostback being true. I tried a bunch of different ways to capture the index or the value that I choose in dropdown2 but it is always always 0!! Any help??i've got 3 dropdownlist and the first two fill the third one:<BR><BR>private void DdlSystems_SelectedIndexChanged(object sender, System.EventArgs e)<BR> {<BR> // get the system that was picked<BR> int choice = Convert.ToInt32(DdlSystems.SelectedItem.Value); <BR> // get its releases and modules<BR> FillDdlReleases(choice);<BR> FillDdlModulesFromSystems(choice);<BR> }<BR><BR> private void DdlReleases_SelectedIndexChanged(object sender, System.EventArgs e)<BR> {<BR> int choice = Convert.ToInt32(DdlReleases.SelectedItem.Value); <BR> FillDdlModulesFromReleases(choice);<BR> }<BR> <BR> private void FillDdlReleases(int aChoice)<BR> {<BR> Releases = new BugTracker.ReleasesDB(); <BR> DdlReleases.DataSource = Releases.GetReleases(aChoice);<BR> DdlReleases.DataTextField = "Release Version";<BR> DdlReleases.DataValueField = "Release ID"; <BR> DdlReleases.DataBind(); <BR> // DdlReleases.Items.Insert(0,new ListItem("<<Release>>","-1")); <BR> }<BR><BR> private void FillDdlModulesFromSystems(int aChoice)<BR> { <BR> // make a new instance of ModulesDB to refer to the database<BR> Modules = new BugTracker.ModulesDB(); <BR> // get all the modules belonging to the system of choice<BR> DdlModules.DataSource = Modules.GetSystemModules(aChoice);<BR> // show the name of the module in the dropdownlist<BR> DdlModules.DataTextField = "Module Name";<BR> // with its ID as the corresponding value<BR> DdlModules.DataValueField = "Module ID";<BR> // bind the data to the listbox to show the obtained values <BR> DdlModules.DataBind();<BR> }<BR><BR> private void FillDdlModulesFromReleases(int aChoice)<BR> {<BR> Modules = new BugTracker.ModulesDB(); <BR> System.Data.SqlClient.SqlDataReader moduleReader= Modules.GetReleaseModules(aChoice);<BR> DdlModules.DataSource = Modules.GetReleaseModules(aChoice); <BR> DdlModules.DataTextField = "Module Name";<BR> DdlModules.DataValueField = "Module ID"; <BR> DdlModules.DataBind(); <BR> }
