If I'm understanding you correctly, we're talking about the following
hypothetical scenario: You have a country list and when the user makes a
selection you either do nothing or you load a list of States/Regions
depending on the selection made?
If that scenario is near enough, you could consider the following approach:
At design time, create the second dropdownlist where ever it should be and
set it's visibility to false, or if you don't mind the user seeing it, set
it's enabled property to false.
Capture the Country list's SelectedIndexChanged event and based on your
conditions either load the second list or do nothing.
eg.
protected void Countries_SelectedIndexChanged(....,....)
{
if (Countries.SelectedIndex > 0)
{
Regions.DataSource =
BizLayer.GetRegions(Convert.ToInt16(Countires.SelectedValue));
Regions.DataTextField = "textField";
Regions.DataValueField = "valueField";
Regions.DataBind();
}
}
Make sure your viewstate is enabled for these lists else you may not get the
expected result.
Hope this helped.
Cheers
Jacques
> I have a static AutoPostBack asp:DrownDownList and depending on the selected
> content of this list, I want to either 1) not do anything or 2) generate and
[quoted text clipped - 3 lines]
>
> Thanks
Bob - 07 Dec 2007 07:44 GMT
Thanks for your response. However on the internet I found exactly what I
was looking for in the following article:
http://aspnet.4guysfromrolla.com/articles/081402-1.aspx
Thanks again.
David C - 07 Dec 2007 17:01 GMT
Have you looked at ASP.Net AJAX? There is a control already built that does
this.
David
> Thanks for your response. However on the internet I found exactly what I
> was looking for in the following article:
>
> http://aspnet.4guysfromrolla.com/articles/081402-1.aspx
>
> Thanks again.