Home > Archive > microsoft.public.cert.exam.mcsd > March 2004 > To capture the list item in drop down





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author To capture the list item in drop down
NW

2004-03-26, 7:24 pm

if your listbox is named "lbMyList" you can access the
value that is selected one of two ways.

1. lbMyList.SelectedItem.Value
2. lbMyList.SelectedIndex.Value

ex
Select something FROM tblData Where MyValue = '" &
lbMyList.SelectedItem.Value & "' ORDER BY whatever"

If you want to do the query automatically when someone
selects a different listitem, then you need to build the
commandtext inside of the selectedindexchanged event
handler.

If you are using web forms, make sure the autopostback
property on the control you are using is set to true.

NW
>-----Original Message-----
>hi all,
>
> I have created a dropdownlist control and populating

the drop downs. now I
>have assigned the values to each of the value appearing

in the dropdown. I
>want to accessthose and pass this to my query that

value. every time I do
>that it passes just one value.
> no idea what to do?
>
> please help
>
>Puneet
>
>
>.
>

Sponsored Links





Free Braindumps | MCSE braindumps software forum

Copyright 2003 - 2008 examnotes.net