G
Guest
I've been experiencing problems with getting the selected value from a DropDownList. I'm using a codebehind-solution and I'm filling a DropDownList with ListItems in the Page_Load method and all works fine. The problem arises when I try to get the selected item in the DropDownList in an event handler method mapped to a button. When I execute the following line
dropDownList.SelectedValu
I always get the value from the first ListItem
The funny thing is that I've got no problems with getting the entered text in for example a text box
What have I missed
The first line of the aspx-page looks like this
<%@ Page language="c#" Codebehind="supportsession.aspx.cs" AutoEventWireup="false" Inherits="Support_Ver2.supportsession" %
and I'm not using AutoPostBack in the DropDownList control.
dropDownList.SelectedValu
I always get the value from the first ListItem
The funny thing is that I've got no problems with getting the entered text in for example a text box
What have I missed
The first line of the aspx-page looks like this
<%@ Page language="c#" Codebehind="supportsession.aspx.cs" AutoEventWireup="false" Inherits="Support_Ver2.supportsession" %
and I'm not using AutoPostBack in the DropDownList control.