Click here to Skip to main content
15,890,512 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
I know how to add controls dynamically in ASP.NET.

I used HtmlGenericControls and added them to a div tag. Now my problem is that, I want to display the control on the page as soon as they are created, i.e. if I add a <p> tag or <a> tag and then add it to a <div> tag. I want to show the div tag as soon as its created.

I have created as many as nearly 100 such div tag using a recursive function. Now the page is updated after all the 100 tags are created but I want to add them as soon as they are created.

I have used the AJAX Update panel, but its not working for me.
Can anyone suggest me a good thing in this.
Posted
Updated 24-Mar-11 19:53pm
v2

 
Share this answer
 
Now the page is updated after all the 100 tags are created but I want to add them as soon as they are created
This is happening as you you are taking an update panel route that follows the page life cycle and once eveything is done then the update panel part gets re-rendered.

Instead, use plain Javascript. On client side, loop through and create the divs and add them to the containers. As soon they will be added they will get displayed.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900