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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T05:19:07+00:00 2026-05-31T05:19:07+00:00

I have generated some questions from a dataset with textboxes next to them in

  • 0

I have generated some questions from a dataset with textboxes next to them in a dynamically generated html table. I have 5 questions and 5 textboxes.
So, i need to get back the values of some textboxes.

I am looping through the dataset and adding a series of questions with textboxes next to them. However, do i need to generate some unique ID to each textbox?

private void GenerateTable(int colsCount, int rowsCount, DataSet ds, DataSet ds2)
{
    if (!IsPostBack)
    {
        int counter = 0;

        List<TableRow> tableRowList = new List<TableRow>();
        List<TableCell> tableCellList = new List<TableCell>();
        List<Control> controlsList = new List<Control>();

        foreach (DataTable dataTable in ds.Tables)
        {
            foreach (DataRow dataRow in dataTable.Rows)
            {
                TableRow tableRow = new TableRow();
                TableCell tableCell = new TableCell();
                TableCell tableCell2 = new TableCell();
                TextBox textbox = new TextBox();
                //textbox.ID = "TextBoxID";

                TableRow tableRow2 = new TableRow();
                TableCell tableCel2 = new TableCell();

                tableCell.Text = dataRow["QUESTIONTEXT"].ToString();


                if (dataRow["TYPEID"].ToString() == "1")
                {
                    tableCell2.Controls.Add(textbox);
                    controlsList.Add(textbox);
                }


                tableRow.Cells.Add(tableCell);
                tableRow.Cells.Add(tableCell2);
                myTable.Rows.Add(tableRow);

                tableRowList.Add(tableRow);
                tableCellList.Add(tableCell);
                tableCellList.Add(tableCell2);

                counter++;
            }
        }

        //TextBox tb = myTable.FindControl(TextBoxID) as TextBox;          
  • 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-05-31T05:19:08+00:00Added an answer on May 31, 2026 at 5:19 am

    Do I need to generate some unique ID to each textbox?

    Yes… id must be unique. a page with more than one element with the same id is invaliid

    spec:

    id=name [CS]
    This attribute assigns a name to an element. This name must be unique in a document.

    But if you are not using the id at all you can just not assign id at all…

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

Sidebar

Related Questions

I have generated a collection of images. Some of them are blank as in
I have a wordpress-generated page where I need some posts (in a specific category)
I have a collection of checkboxes with generated ids and some of them have
So I need to dynamically call and execute the javascript code generated from external
I have some data generated in MATLAB that I want to process using Perl.
I have been given some generated code which looks like so: <form id=form1 method=post
I have a generated nested Array which I store some data. How can i
I have a form with some generated input fields like theese: <input value=March name=month[March]
I have some types which are generated by a web service reference. I want
I have some pages on my public website that display charts generated by ASP.NET

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.