Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9242437
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T08:34:45+00:00 2026-06-18T08:34:45+00:00

In an ASPX page, I am populating the rows of a table programatically by

  • 0

In an ASPX page, I am populating the rows of a table programatically by filling up a server-side string with contents and then putting it in the output HTML with a construct <tbody><%=mystring%></tbody>.

One of the <td> elements of the row is a button to delete the row, and I need to pass to the server another <td> element in the row.

In the server-side code that prepares the table, I tried with:

string RowTemplate; 
RowTemplate = "<tr><td>{0}</td><td>{1}</td><td>{2}</td><td><form action=\"/submit\" name=\"removeemail{0}\" runat=\"server\"><input custom=\"{1}\" class=\"btn icon-remove\" value=\"X\" onserverclick=\"RemoveEmail\" runat=\"server\"/></form></td></tr>";

Then, as I create rows, the place holders {0}, {1}, and {2} are replaced by the row’s corresponding values.

The idea is to retrieve the “custom” attribute (the key for deletion) at the server-side function called RemoveEmail, and then build the table again without the removed row.

However, it seems that the generated HTML for this inline form is not preprocessed by ASPX engine so HTML code that reaches the browser is directly the ASPX HTML markup.

How could I have the ASPX markup preprocessed so that it behaves exactly as static ASPX markup like the one that is find an a .aspx file? If that is not possible, how could I manage server-side deletion with an inline button on a table row in ASPX?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T08:34:46+00:00Added an answer on June 18, 2026 at 8:34 am

    I don’t think that by adding runat="server" to these HTML Controls will make them work as server side controls. You can add runat="server" to the markup, and that would work. This is one way I would do this:

    Markup:

    <body>
        <form id="form1" runat="server">
        <div>
           <asp:Table runat="server" ID="tbl"></asp:Table>
        </div>
        </form>
    </body>
    

    Code Behind:

    TableRow tr = new TableRow();
    tr.Cells.Add(new TableCell() { Text = "Argument0" });
    tr.Cells.Add(new TableCell() { Text = "Argument1" });
    tr.Cells.Add(new TableCell() { Text = "Argument2" });
    TableCell td = new TableCell();
    Button btn = new Button();
    
    tr.Cells.Add(td);
    btn.Text = "Remove Email";
    btn.Click+=new EventHandler(removeEmail);
    
    td.Controls.Add(btn);
    this.tbl.Rows.Add(tr);
    
    void removeEmail(object sender, EventArgs e)
    { 
        //code here
    }
    

    This adds the Button control to a TableCell, and attaches the removeEmail() event to this button.

    Good luck.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to create cascading DDLs. My aspx page: <form id=form1 runat=server> <table> <tr>
I have the follow aspx page <asp:Content ID=Content2 ContentPlaceHolderID=contentConteudo runat=server> <table border=0 width=680 style=background-color:#f0f0f0
So on my Default.aspx page I have several listboxes which I am populating on
I am having multiple dropdownlists in my aspx page. Reletively I am populating all
I have a aspx page which contains the following CheckBoxList. <form id=form1 runat=server> <asp:CheckBoxList
//ASPX PAGE <div id=nonPrintable> <table width=98% border=0 cellspacing=2 cellpadding=0 align=center> -- --</table> </div> <br/>
I have a search.aspx page that has this: <asp:DropDownList id=ddlPopulation runat=server DataTextField=population DataValueField=pid> </asp:DropDownList>
So I have an .aspx page loading up and populating drop downs based on
aspx page:- <asp:Repeater ID=rptAdd OnItemCommand=rptAdd_ItemCommand runat=server> <ItemTemplate> <td> <asp:LinkButton ID=lnkBill Text=Make Default runat=server Visible=true
I'm populating a DataGrid in my .aspx page and have some dropdowns on the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.