Asp Table Problem

Discussion in 'ASP .Net' started by =?Utf-8?B?RGF2ZXkgUA==?=, Jun 6, 2005.

  1. I have a asp table which I am populating dynamically server side with various
    other controls such as text boxes, drop down lists and buttons. The controls
    in this table are filled with data stored in a data table (if there is any).
    On the first load of the page I create the datatable and set the columns up
    to store the data entered into the controls within my asp table. I then have
    a tablecreate method which basically checks to see if any data is held in my
    datatable, and if so then render my asp table cell-by-cell, filling the
    controls in accordingly. I have a button called 'remove' in the final cell of
    a row in my asp table. When I dynamically create the button and add it to the
    table, I assign it an event handler for the click event. The main function of
    this button is to remove the given row. I planned to achieve this by removing
    the row from the datatable from which the table is populated, and then
    calling the tablecreate method again. The problem is that when I click on the
    button, the page load method is hit first which renders my table, and then
    the button event is hit, which removes the row from the datatable. So you
    click remove and nothing appears to happen, but on the next postback the row
    is removed. Why is the button click being hit after page load, and is there
    any way I can fix this or manually tell the asp table to redraw itself?
    Thanks in advance.
    =?Utf-8?B?RGF2ZXkgUA==?=, Jun 6, 2005
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. David Williams
    Replies:
    2
    Views:
    1,104
    Jacob Yang [MSFT]
    Aug 12, 2003
  2. Ken Dopierala Jr.

    Do you use <table> or <asp:Table>?

    Ken Dopierala Jr., Jan 12, 2004, in forum: ASP .Net
    Replies:
    5
    Views:
    8,594
    Craig Deelsnyder
    Jan 13, 2004
  3. Beffmans
    Replies:
    1
    Views:
    5,356
    John Timney \(ASP.NET MVP\)
    Jul 8, 2005
  4. Rio
    Replies:
    4
    Views:
    1,172
  5. Yas
    Replies:
    0
    Views:
    473
Loading...

Share This Page