Loading a User Control on an ASPX

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.
 
D

David Longnecker

Try encompassing your logic in Page_Load with

if(! IsPostBack)
{
<code>
}

-dl
 

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

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,241
Members
46,831
Latest member
RusselWill

Latest Threads

Top