Reputation: 55
Dim ename As String = DropDownList.SelectedItem.Value
this statement is'nt working any help is appreciated!!
Upvotes: 3
Views: 44644
Reputation: 126563
You need to store the value into a session variable, not only in a String variable:
Dim ename As String = DropDownList.SelectedItem.Value
Session("yourKey") = ename
Upvotes: 0
Reputation: 1
I tried DropDownList.SelectedItem.ToString() & it worked. I tried without the parentheses too & it still work in visual basic. I hope it will work for you too.
Upvotes: 0
Reputation: 55467
I'm not sure if this is your problem, but if you're looking for the text of the item (instead of the value) you need DropDownList.SelectedItem.Text
.
To store in session, you can just use
Session("yourKey") = DropDownList.SelectedItem.Value
Upvotes: 5