Last post Jun 20, 2010 08:18 AM by Caspar Kleijne
Jun 08, 2010 09:19 AM|rahul1234|LINK
I am using two user controls in my page. The controls are loaded dynamically one at a time. I'm just referencing the user controls in the page and loading them dynamically using 'LoadControl()'. Everything is working fine till now and the user can switch
the controls one another.
Here the issue I found is eventhough the controls are working as expected and the data is visible, the rendered HTML contains only the first loaded user control's markup.
Even if the current control displayed is 'usercontrol2', the source shows 'usercontrol1' markup. How can I force the page to render 'usercontrol2' markup and remove 'usercontrol1' markup while loading 'usercontrol2'?
Thanks in advance.
Jun 08, 2010 09:31 AM|MartijnS777|LINK
Could you post the relevant code. I'm wondering how you exactly implemented this.
Jun 10, 2010 04:46 AM|Qin Dian Tang - MSFT|LINK
Here are some articles about adding user control dynamically:
Jun 10, 2010 08:29 AM|rahul1234|LINK
Hi Qin Dian Tang,
Thanks for coming forward with a reply.
I did not have an issue with dynamic user control loading. Actually I did this and is working fine also.
My question is whether this can be overwritten by forcefully rendering the current user control and if yes how?
Or is this an issue with the control loading logic? and if yes, did anybody have a code sample which works fine in this case too?
Jun 10, 2010 11:04 PM|Qin Dian Tang - MSFT|LINK
Here are some links about how to access the control in user control:
Jun 14, 2010 03:33 AM|rahul1234|LINK
Again it is not an answer to my question. The question is whether a dynamic usercontrol can forcefully call render method to render its html controls in the page?
Jun 20, 2010 08:18 AM|Caspar Kleijne|LINK
As Martijn said, It would be helpful if you could post some code ;)