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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T21:56:43+00:00 2026-05-27T21:56:43+00:00

if I have a datalist with textbox and a button inside and i want

  • 0

if I have a datalist with textbox and a button inside and i want to access the value of the textbox and pass it to the listener of the button, anyone knows how to do that?

  • 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-27T21:56:44+00:00Added an answer on May 27, 2026 at 9:56 pm

    I know how.

    Let’s say you have a DataList name myDataList, and a TextBox in it named by myTextBox.

    foreach (DataListItem item in myDataList.Items)
    {
        TextBox myTextBox = (TextBox)item.FindControl("myTextBox");
        string text = myTextBox.text;
        // Do whatever you need with that string value here
    }
    

    This loops through all of the items in your DataList and places the value of your TextBox into a local string variable named “text”. From there, you can do whatever else needs to be done.

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

Sidebar

Related Questions

I have a DataList inside another DataList. I want to access the child DataList
I have Datalist that is inside an updatepanel and it is in panel in
I have a DataList control that displays a set of elements. Can anyone point
I have a datalist control which some controls(ex: button) are in it. I want
I have a datalist inside a usercontrol that gets loaded into a page where
I have a DataList that Displays some Posts with a RadioButtonList inside where it
I have a datalist that contains a gridview inside its itemtemplate. on the item-data_bound
I have a DataList inside a DataList that causes my page to lose the
I have a DataList and inside of each item there is an ImageButton that
I have a datalist with a OnDeleteCommand=Delete_Command. I want the delete a record with

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.