Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Web part, controls and view state

Status
Not open for further replies.

elinM

Programmer
Feb 12, 2004
15
NO
Hi,

I'm trying to develop my first webpart. It contains a radionbuttonlist. The list is initialization in CreateChildControls.
protected override void CreateChildControls()
{
if(!Page.IsPostBack)
{
rbList = new RadioButtonList();
rbList.Items.Add("Contact");
rbList.Items.Add("Document");
rbList.Items.Add("Project");
rbList.SelectedIndexChanged +=new
evntHandler(rbList_SelectedIndexChanged);
rbList.AutoPostBack = true;
}
else
{}

}

When the user select a radionbutton, the rbList become <Undefined value>. I've tryed to set this.EnableViewState = true... but still it's even a user hits a button the rbList become <Undefined value>.

Do anybody know what I can do??

regards;
elin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top