Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net (http://www.velocityreviews.com/forums/f29-asp-net.html)
-   -   dynamic DropDownList custom control (http://www.velocityreviews.com/forums/t68583-dynamic-dropdownlist-custom-control.html)

will 12-11-2003 01:39 AM

dynamic DropDownList custom control
 
hi,

i'm trying to create two custom DropDownLists, DropDownList_Countries
and DropDownList_Cities

in DropDownList_Countries, i have a

public override void DataBind()
{
.....
}

which runs a SQL query, and eventually base.DataBind();


in DropDownList_Cities, i have a similar setup but the SQL query
includes a condition which is from the selection of
DropDownList_Countries. eg

"SELECT * FROM tbl_cities WHERE country='" +
DropDownList_Countries.SelectedItem.Value + "';"


what i'm trying to achieve is to display two dropdownlists on a webpage,
DropDownList_Countries has a list of options while DropDownList_Cities
is empty. as soon as something's selected in DropDownList_Countries,
this control does a autopostback and at this point, DropDownList_Cities
should have a list of options derived from the selected country.

however, i can't build this .dll, it says DropDownList_Countries cannot
be found. obviously DropDownList_Countries.SelectedItem.Value is not the
correct way to express the selected value. what shoud i do?

thanks

will.


All times are GMT. The time now is 01:10 PM.

Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57