|
-
Aug 8th, 2005, 09:17 PM
#1
Thread Starter
Lively Member
select a specific Item???
How to select a specific Item in a DropDownList in asp.net?
using SelectedIndexChanged I can select any items in a DropDownList that i bind in my database but the result gives me the first item always which is the value of index 0 or first item.
the result should be whatever item that i selected in my DropDownList...
Last edited by Chowking; Aug 8th, 2005 at 09:58 PM.
-
Aug 8th, 2005, 09:54 PM
#2
Addicted Member
Re: select a specific Item???
VB Code:
s = lst.Items(lst.SelectedIndex).Text
-
Aug 8th, 2005, 10:26 PM
#3
Thread Starter
Lively Member
Re: select a specific Item???
When i false my AutoPostBack properties, I can now select any item in my DropDownList.
How would i post the selected item to my textbox?
I tried this code in SelectedIndexChanged but it wont work at all.
"STRinfo.Text = STRinfo.SelectedItem.Value"
-
Aug 8th, 2005, 10:47 PM
#4
Addicted Member
Re: select a specific Item???
VB Code:
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Response.Write(drp.Items(drp.SelectedIndex).Text)
Response.Write(drp.SelectedItem.Text)
End Sub
I tried it and it works fine...
-
Aug 8th, 2005, 10:49 PM
#5
Fanatic Member
Re: select a specific Item???
it shud be something like this:
STRinfo.Text = dropdownname.SelectedValue
If a post has helped you then Please Rate it!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|