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 8498993
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T00:33:04+00:00 2026-06-11T00:33:04+00:00

I have a ASP.NET Table control which I have dragged to my page. I

  • 0

I have a ASP.NET Table control which I have dragged to my page. I have to create the rows and columns dynamically which I have also done. Some of the cells in my table are textboxes. I want to be able to modify the textbox values and save the changes. I have added a button within the same panel as the table but when I try to loop through the tables rows I get zero.

Why is the table not remembering my rows and cells? As I have already loaded the data once I don’t want to rebuild the table each time a button is pressed. I think by creating the table each time in Page_Load I’d be going back and forth to the database server. I really want to avoid this.

  • 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-11T00:33:05+00:00Added an answer on June 11, 2026 at 12:33 am

    You can store your dynamically created table in view that you can fetch after rendering.

    SqlConnection con =new  SqlConnection(ConfigurationManager.ConnectionStrings["dbstring"].ConnectionString);
    
    private int ctrName = 0;
    Table tableName = null;  
    
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            tableName = new Table();
            tableName.ID = "tableName";
            Session["tableName"] = tableName;
            ViewState["ctrName"] = ctrName;
        }
        ctrName = (Int32)ViewState["ctrName"];
        tableName = (Table)Session["tableName"];
        pnlName.Controls.Add(tableName);
    }
    private void GenerateName()
    {
        ctrName++;
        TableRow row = new TableRow();
        TableCell cell = new TableCell();
        TextBox tb = new TextBox();
        tb.ID = "Txt_Name" + ctrName;
        tb.Width = 150;
        cell.Controls.Add(tb);
        row.Cells.Add(cell);
        tableName.Rows.Add(row);
        Session["tableName"] = tableName;
        ViewState["ctrName"] = ctrName;
    }
    

    For Access the table details:

    tableName = (Table)Session["tableName"];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a button on my ASP.NET page, which fetches some data from my
I'm developing an ASP.Net project. I have an <asp:Table> control on my page, to
I have an ASP.net Login Control which has a link to CreateUserWizard page(register). When
I have dragged a empty asp.net table onto my webform. I generate all the
I have an ASP.NET page and I am generating an HTML table in my
I have a table of results in an ASP.Net MVC page where the last
I have created a master page in asp.net which dont have any server side
I'm using the asp:Menu control on an ASP.NET 4.0 Webforms page with table-free rendering
I have an ASP.NET 4.0 home page which displays about 20 product listings. Each
(ASP.NET Web Application) I'd like to create a page which allows the user to

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.