Loading a User Control on an ASPX

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I have an ASP.NET Page.

My page has a user control which is added to a panel programmatically.

My user control has a series of dropdowns.

When the user selects some values and clicks on submit when the postback
happens I need to reload the ascx each time. This is fine.

However as I reload it the dropdowns on the ascx are repopulated as I call
some methods in the Page_Load of my ascx in order to fill the dropdowns.

As a result the selected values are lost.

Anyne know how I can overcome this problem?

Thanks in Advance.
 
Try encompassing your logic in Page_Load with

if(! IsPostBack)
{
<code>
}

-dl
 
Back
Top