1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Adding Buttons to ASP Table rows in c#/ASP.NET

Discussion in 'C#' started by croker10, Sep 2, 2010.

  1. croker10

    croker10 New Member

    Sep 2, 2010
    Likes Received:
    Trophy Points:
    Hi all,
    I am trying to create a table of user created filters for a data set and then display the filters in an ASP:Table. Displaying the filters works fine, and I have no problem there. The issue I am having is that the buttons I am trying to add are not adding in the way I think they should.

    I am setting the ID, Text, and OnClick events in my code behind in C#, but when I debug and view the source, the values have all been changed, and I can't understand why.

    The buttons need to be added, being called "buttonX" where X is the row number the button is in, so I can distinguish later to remove filters if the user clicks on them.

    If you think any other code would be helpful to figuring this out, I'd be happy to supply.

    Please let me know if you have any ideas, the code behind is here:

           Button b = new Button();
           b.OnClientClick = "delete_Item";
           b.ID = "delete" + count;
           b.Text = "Remove";
           b.Click +=new EventHandler(delete_Item);
           TableCell temp = new TableCell();
    And the html output is:

    Age Range25 - 36

Share This Page