Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NETHTMLAjax
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 24-Mar-11 13:30pm
Edited 24-Mar-11 19:53pm
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

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.
  Permalink  

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

  Print Answers RSS
Your Filters
Interested
Ignored
     
0 Shai Vashdi 600
1 Tadit Dash 305
2 Sergey Alexandrovich Kryukov 250
3 Peter Leow 190
4 OriginalGriff 148
0 Sergey Alexandrovich Kryukov 9,395
1 OriginalGriff 5,473
2 Peter Leow 4,150
3 Maciej Los 3,540
4 Abhinav S 3,333


Advertise | Privacy | Mobile
Web02 | 2.8.140415.2 | Last Updated 25 Mar 2011
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Use
Layout: fixed | fluid