473,378 Members | 1,470 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Dropdown viewstate probelm

Dears,

I've a problem in the viewstate regarding the dropdown list, i'm populating
it on the page load if it's not a postback and the enable viewstate is
enabled on the control and the page, and when a control submits the dropdown
list is rendered empty !, i've tested the code on another server and it's
working fine so i checked the web.config and found the viewstate="true" in
the page tag.

=================================
if (!IsPostBack)

{

ht.Add("medo","medo");

ht.Add("teto","teto");
//this.DropDownList1.DataSource=ht;

//this.DropDownList1.DataBind();
this.DropDownList1.Items.Add("medo");

this.DropDownList1.Items.Add("dedo");

}

=================================================

Please advise.

Regards,
Mohamed
Nov 18 '05 #1
0 825

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Jim Mitchell | last post by:
My Goal is to have a dropdown (DL2) filled from the selectIndexChange event of a primary dropdown (DL1). These are picklists that will be selected frequently. Can someone recommend a strategy...
0
by: Manish | last post by:
Hi All, I'm having this problem I hope someone can help provide a solution for it :) I've this dropdown list box in a usercontrol which I'm populating from the database (it's viewstate property...
3
by: Lloyd Sheen | last post by:
I have a page that works fine. I am trying to optimize the page by overriding some of the Information that is being saved in the hidden VIEWSTATE. If I make the properties of the dropdown False...
2
by: Chris Lane | last post by:
Hi, I have a web control button that I use for submitting a form, for some reason this causes a dropdownlist web control I have in a panel at the top of the form to execute it's selected index...
2
by: GHQ Dev | last post by:
I have an aspx page (page1.aspx) that post back to another aspx page (page2.aspx) “page2.aspx” has a button called back, when the user click on this button it is supposed to return to...
2
by: Steve Pierce | last post by:
I am having some issues with a runtime dropdownlist in a datagrid. The issue is that I cannot get ViewState to fill the selected index of a runtime dropdown properly on postback. I do not want to...
2
by: cmay | last post by:
A common situation I come across is an ASCX control that being used as a lookup control. The ascx might be called "StatusLookup" or something, and it consists of 1 dropdown list that populates...
3
by: =?Utf-8?B?SmF2YW1hbjU5?= | last post by:
I have an ASP.NET example which programmatically builds a drop down list. public class WebForm1 : System.Web.UI.Page { protected System.Web.UI.WebControls.DropDownList ddlCategories; public...
3
by: John | last post by:
I have two dropdown lists that I have bound to a datatable and set the DataTextField and DataValueField for. Both lists show the values I expect from the database. However, when I need to access...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.