thats where i got the above code from but it doesnt seem to work for me
Main Topics
Browse All TopicsHi
I am trying to add a user control to a UpdatePanel but cant seem to get it to work, if I dont use an update panel then it works fine.
I am sure there is something I am doing wrong and am missing something but no idea what
Any help would be great
This is what I have:
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
I had this problem before with an update panel, trying to add to a contenttemplate. I never could get the right type of object built that the contenttemplate would accept it....drove me nuts!
Maybe I've gotten smarter since then... hmmm.
Well I feel smarter, but I dunno that this helps you at all :)
I took pieces of your code and began to add them to my own page to see if I could get this done. What I found is that I could add a usercontrol to the contenttemplate with ease. Then I begain adding components or concepts from your code in in an attempt to break things....
I never was able to cause it to fail. The only thing I didnt do was add the viewstate stuff and dynamically create the string for loading of the usercontrol.
I'm using NET 3.5 maybe that makes some difference?
I'm posting what I built below in case it can be of any use to you.
The one problem with your code I did not was in the updatepanel triggers section. I had to change your code slightly thus:
<asp:AsyncPostBackTrigger ControlID="linkLoadREProfi
You didn't say what the error you were having was specifically. I assumed it was simply that no errors occurred, but you got no usercontrol in the contenttemplate.
This strikes me as strange since I got an error until I fixed that trigger property. My guess is that there is something keeping you from loading the proper usercontrol, or there is a difference in our platforms that is causing me to succeed where you fail.
That's strange. I only did what you did:
Protected Sub page_load(ByVal obj As Object, ByVal e As EventArgs)
LoadUserControl()
End Sub
I fail to see how my code is different from your except I took a shortcut. I also fail to see why it would matter whether I did it on button click on page load? Just to be sure though I wired it up the way you just mentioned and it still works.
I'm still saying your asyncpostbacktrigger event is wrong which would cause the event not to fire. You wouldnt see this without the updatepanel because you wouldnt have the asyncpostback trigger.
Business Accounts
Answer for Membership
by: NNirmalanPosted on 2009-06-18 at 01:03:00ID: 24655307
http://geekswithblogs.net/ rashid/arc hive/2007/ 08/11/Load ing- UserCo ntrol-Dyna mically-in -UpdatePan el.aspx
ck this
Che