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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamic custom control disappears after postback

Status
Not open for further replies.

bigoldbulldog

Programmer
Feb 26, 2002
286
US
Hi,

I am loading 1 of 4 custom controls dynamically into a placeholder control. These controls have a variety of dropdowns, gridviews and other things.

I load from a LinkButton_OnClick event using PlaceHolder.Controls.Add(LoadControls("~/CustCtrl1.ascx")); and all is fine until I try using one of the dropdowns or other controls in the custom control. The the page is posted back without the dynamic control at all.

The dropdown does have autopostback="true". However, if I do the dynamic load in the page load event, then the custom control works fine. But I want to change that control using the OnClick event. Any thoughts on getting this to work?

Cheers,
ND [smile]
 
However, if I do the dynamic load in the page load event, then the custom control works fine.
That's because it is dynamic. If you don't load it every time the page is loaded, it won't be created. There's no workaround, you simply have to create it every time.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top