|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
DropDownList ValueHi All,
How do I get the value of the DataValueField that is selected. I don't want the SelectedValue I want the actual field value. So, if I display Staff Names within the drop down list, I don't want the Staff Name, I want the StaffID which is the value contained in the DataValueField. Thanks, Joe It should be like this.
value=ddownlist.items[ddownlist.selectedindex].value; textvalue=ddownlist.items[ddownlist.selectedindex].text; this Borland like language, but in Studio languages it should sound familiar. Hans Show quoteHide quote "Joe Reiss" <joere***@bellsouth.net> schreef in bericht news:TC2if.27619$s92.4855@bignews6.bellsouth.net... > Hi All, > > How do I get the value of the DataValueField that is selected. I don't > want the SelectedValue I want the actual field value. > > So, if I display Staff Names within the drop down list, I don't want the > Staff Name, I want the StaffID which is the value contained in the > DataValueField. > > Thanks, > Joe > Thanx,
I was able to work it out. 'Borland like' doesn't surprise me since C# is Anders Heilsberg (spelling?) baby. Of course he was mostly responsible for Delphi of which has been my development language since 1995. Show quoteHide quote "Hans" <i***@tct.nl> wrote in message news:438c98cc$0$2336$ba620dc5@text.nova.planet.nl... > It should be like this. > > value=ddownlist.items[ddownlist.selectedindex].value; > textvalue=ddownlist.items[ddownlist.selectedindex].text; > > this Borland like language, but in Studio languages it should sound > familiar. > > Hans > > > "Joe Reiss" <joere***@bellsouth.net> schreef in bericht > news:TC2if.27619$s92.4855@bignews6.bellsouth.net... >> Hi All, >> >> How do I get the value of the DataValueField that is selected. I don't >> want the SelectedValue I want the actual field value. >> >> So, if I display Staff Names within the drop down list, I don't want the >> Staff Name, I want the StaffID which is the value contained in the >> DataValueField. >> >> Thanks, >> Joe >> > >
Other interesting topics
custom control client values gone with postback
Cool Web Parts? Server Control - object not saved when button clicked Newbie - question concerning page behaviour Problems with Custom Web Controls in VS 2005 Setting focus to TextBox Mouseover, mouseout, click etc on datagrid. DataList Issue Time textbox control TableAdapter Scalar or "Single Value" Queries |
|||||||||||||||||||||||