Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > DropDownList not maintaining viewstate

Reply
Thread Tools

DropDownList not maintaining viewstate

 
 
Carlos A. Manzanares
Guest
Posts: n/a
 
      11-10-2003
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.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
3 ESSENTIAL TOOLS FOR STARTING AND MAINTAINING...3 ESSENTIAL TOOLSFOR STARTING AND MAINTAINING...3 ESSENTIAL TOOLS FOR STARTING ANDMAINTAINING... Oanh Bui C++ 0 04-27-2009 12:51 PM
3 ESSENTIAL TOOLS FOR STARTING AND MAINTAINING...3 ESSENTIAL TOOLSFOR STARTING AND MAINTAINING...3 ESSENTIAL TOOLS FOR STARTING ANDMAINTAINING... Oanh Bui C Programming 0 04-27-2009 12:51 PM
3 ESSENTIAL TOOLS FOR STARTING AND MAINTAINING...3 ESSENTIAL TOOLSFOR STARTING AND MAINTAINING...3 ESSENTIAL TOOLS FOR STARTING ANDMAINTAINING... Oanh Bui Python 0 04-27-2009 12:46 PM
Checkbox in DataList not maintaining viewstate Charlie@CBFC ASP .Net 0 04-02-2005 07:32 AM
DropDownList not maintaining viewstate sklett ASP .Net 4 04-08-2004 06:25 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57