views:

29

answers:

2

I dynamically load a UserControl, with an updatepanel inside, into a placeHolder. When I click an button into UserControl, should refresh the updatepanel that there are in it, but refresh entire page and the user control disappears because the aspx page's Page_Load don't load anything if it's a postback. How I can fix it?

PD: sorry for my english

A: 

I think you'll need to reinject the control in page_load or pre_render. Dynamically created controls don't live through postback.

aape
A: 

Make sure you are creating the control EVERY page request, regardless of GET/POST. Also, make sure you are giving it the same ID.

I like to override the CreateChildControls method.

matt-dot-net