C
Carlos A. Manzanares
Hey all. I have an ASP.NET page using C#. In the page I have a
DropDownList. I have the document "EnableViewState" set to TRUE. I have
the DropDownList control "EnableViewState" set to TRUE.
The DropDownList is populated when "Page.IsPostBack" is false.
However, when the page is posted back, the DropDownList is empty. It is not
maintaining it's viewstate and I can't find a reason for this to happen.
Here is some code:
In the ASPX page:
<aspropDownList id="ddlGroup" runat="server" CssClass="textBox"
Enabled="true" AutoPostBack="True"
EnableViewState="true"></aspropDownList>
The list is populated in the code-behind page with this method:
My Page_Load contains:
if (!Page.IsPostBack)
{
FillList();
}
The FillList() method just connects to the database to retrieve data and
populate the DropDownList.
DropDownList. I have the document "EnableViewState" set to TRUE. I have
the DropDownList control "EnableViewState" set to TRUE.
The DropDownList is populated when "Page.IsPostBack" is false.
However, when the page is posted back, the DropDownList is empty. It is not
maintaining it's viewstate and I can't find a reason for this to happen.
Here is some code:
In the ASPX page:
<aspropDownList id="ddlGroup" runat="server" CssClass="textBox"
Enabled="true" AutoPostBack="True"
EnableViewState="true"></aspropDownList>
The list is populated in the code-behind page with this method:
My Page_Load contains:
if (!Page.IsPostBack)
{
FillList();
}
The FillList() method just connects to the database to retrieve data and
populate the DropDownList.