locked
when ever a user click on add button a new row with another dropdown lists should be added to an existing table RRS feed

  • Question

  • User-854744733 posted

    Hi everyone, 

    I am adding a Table(server control)  to a usercontrol . the table consists a row containing drop down lists with add button . when ever a user click on add button a new row with another dropdown lists should be added.

    is there any way to copy existing row? so that it uses AJAX not page post back .

     

     I tried to a add new row in button click event to the table. even though a row is showing up on the user control as in pre-render  but it is not adding to the table i intended to add when the page is post backed

    i.e when the page is reloaded it shows a initial single row but not the rows i added. 

    it would be great if anyone can help me with this

     

    Thanks

     

     

     

     

    Friday, June 20, 2008 6:05 PM

Answers

  • User1968518401 posted

    So you r getting a new row but it is in page_prerender right? try using delegate.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, June 24, 2008 8:54 AM

All replies

  • User-1136466523 posted

    Hi,

    is there any way to copy existing row? so that it uses AJAX not page post back .

    From your description, do you mean you want to add a table row to your existing table without the postback, right?

    If so, why don’t you add an UpdatePanel in your user control, and when the button be triggered, just add the new row to your table programmatically.

    when the page is reloaded it shows a initial single row but not the rows i added.

    Generally, the reason of the issue is that the table’s initialization code snippet has been re-executed while page’s post back occurs. You need to use IsPostBack property to neglect those codes to avoid the table’s re-initializing.

    Thanks.

    Tuesday, June 24, 2008 1:59 AM
  • User1968518401 posted

    So you r getting a new row but it is in page_prerender right? try using delegate.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, June 24, 2008 8:54 AM