DropDownList not maintaining viewstate

  • Thread starter Carlos A. Manzanares
  • Start date
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:
<asp:DropDownList id="ddlGroup" runat="server" CssClass="textBox"
Enabled="true" AutoPostBack="True"
EnableViewState="true"></asp:DropDownList>

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,481
Members
44,900
Latest member
Nell636132

Latest Threads

Top