I have the following drop down list:
<asp:DropDownList runat="server" ID="ddlShipping" CssClass="shippingMenu" AutoPostBack="true">
<asp:ListItem Text="3-5 working days (£12.50)" Value="" />
<asp:ListItem Text="3-5 working days - Pre-Midday (£25)" Value="" />
<asp:ListItem Text="3-5 working days - Pre-10.30am (£35)" Value="" />
<asp:ListItem Text="3-5 working days - Pre-9am (£45)" Value="" />
</asp:DropDownList>
In a blank aspx page. When I run the page, and select an item, it causes a postback, and then always returns the the first value in the list.
Does anyone have any idea whats causing this. It is not databound in any way, in fact here’s the code-behind:
public partial class Default4 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
}
The reason that it’s in a blank page was just to isolate the problem from any other code.
All the items have the same (empty) value, so ASP.NET can’t determine which one you mean.
Give them distinct values.