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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T19:48:07+00:00 2026-06-11T19:48:07+00:00

1 – Is it possible to handle controls that generate dynamically via java script

  • 0

1 – Is it possible to handle controls that generate dynamically via java script or other way in page ?

2- What is the mechanism of find control, if I have my TextBox in UpdatePanel ?

For Example how can i get value of controls(textBox) that has been added to table :

for (int i = 0; i < rowsCount; i++)
        {
            TableRow row = new TableRow();
            for (int j = 0; j < colsCount; j++)
            {
                TableCell cell = new TableCell();
                TextBox tb = new TextBox();
                tb.ID = "txtSabeghe_" + (i + 1) + "Col_" + (j + 1);
                cell.Controls.Add(tb);
                row.Cells.Add(cell);
            }
            Table5.Rows.Add(row);
        }

Table And button of Function Both Are in Update Panel to Avoid Postback

  • 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-11T19:48:08+00:00Added an answer on June 11, 2026 at 7:48 pm

    Your question is too general, but I’ll do my best to answer based on what I “think” you’re asking.

    1. Yes, all .net controls render as HTML in the DOM so you can handle them exactly as you would a DOM element, except that .net renders DOM with extra stuff in the id attribute i.e. ctl_001_ etc, so you need to use the ClientID property. You can of course set the ClientIDMode to Static in the web.config as this article shows, this will leave the IDs as you specify.

      <asp:TextBox runat="server" id="mytextbox" />
      

      And your script.

      // without ClientIDMode = 'Static'
      var element = document.getElementById('<%=mytextbox.ClientID%>');
      
      // with ClientIDMode = 'Static'
      var element = document.getElementById('mytextbox');
      
    2. Control.FindControl is a server side method (of the Control base class) that takes the ID (as a string) of the control you want to find, which can be used as follows.

      <asp:Panel runat="server" id="mypanel">
          <asp:TextBox runat="server" id="mytextbox" />
      </asp:Panel>
      

      And in your code behind.

      TextBox tbx = mypanel.FindControl("mytextbox");
      

    EDIT – Finding a control using master pages

    If you want to find your control using master pages, you’re best filtering through the parents like so.

    // parent place holder in master page
    ContentPlaceHolder cph = (ContentPlaceHolder)this.Master.FindControl("ContentPlaceHolderID");
    
    // parent panel in content place holder
    UpdatePanel pnl = cph.FindControl("UpdatePanelID");
    
    // child of parent that you're interested in
    TextBox tbx = pnl.FindControl("TextBoxID");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got the following login script.. <?php $name = $_POST[name]; $password = $_POST[password]; $query
Have a webpage that will be viewed by mainly IE users, so CSS3 is
I'm trying to craft a Java regular expression to split strings of the general
Possible Duplicate: replace all occurrences in a string I found this question/answer: Use JavaScript
I have a simple restful service that transforms a JAXB-anntotated beans to response XML
My NSXMLParser breaks on this string: <title>AAA &#8211; BCDEFGQWERTYUIO</title> I parsed it in this
I'm building a small parser that scrapes web pages and logs the data on
I need a function that will clean a strings' special characters. I do NOT
I have a PHP application that stores PHP datetime to my MySQL table. I
I am getting notice on line 30 that twetout is undefined variable <?php $username

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.