Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > dynamic DropDownList custom control

Reply
Thread Tools

dynamic DropDownList custom control

 
 
will
Guest
Posts: n/a
 
      12-11-2003
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.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Dynamic use of User control within custom control RichB ASP .Net 0 09-24-2008 10:56 AM
placement of dynamic control depends on VALUE of dynamic control Larry Bud ASP .Net 1 01-10-2007 10:07 PM
Custom control within a custom control J R M ASP .Net 2 06-01-2006 06:04 PM
Capturing event from other custom control within another custom control Jonah Olsson ASP .Net 1 04-05-2005 01:39 PM
ControlDesigner not invoked on custom control when control is rendered within another custom control Matt Sokol ASP .Net Building Controls 2 08-07-2003 07:13 AM



Advertisments
 



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