I have a problem about ViewState. ( source code included )

Z

zimzion

Hi..

I posted same question. But it was difficult to show the
point of the problem. So I made an example.

First, there is an a.aspx and a c.ascx. The code of
a.aspx is like that.

private void a_PreRender(object sender, System.EventArgs
e)
{
Control control = Page.LoadControl( "c.ascx" );
PlaceHolder1.Controls.Add( control );
}
}

UserControl c.ascx is loaded at PreRender event of
a.aspx. And c.ascx just has one dropdownlist which has
several items. And the auto post-back property of the
dropdownlist is set to true.

In this situation, if you change the selected item in the
dropdownlist the ViewState of the dropdownlist won't be
consisted.

I want to consist the ViewState. Is this impossible?

thank you.
zimzion
 

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

Top