Hi,
When I add AutoPostback = True to my DropDownList (with OnSelectedIndexChanged) I get a System.ArgumentNullException: Value cannot be null.
My control looks like this:
<asp:DropDownList ID="dropdown" runat="server" AutoPostBack="true" OnSelectedIndexChanged="dropdown_OnSelectedIndexChanged" />
And code to fill control:
dropdown.Items.Add(new ListItem("Item 1", "1"));
dropdown.Items.Add(new ListItem("Item 2", "2"));
dropdown.Items.Add(new ListItem("Item 3", "3"));
Update
I get the error when adding an empty page with the following code too:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_dev_test_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:DropDownList AutoPostBack="true" ID="DropDownList1" runat="server" />
</div>
</form>
</body>
</html>