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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T09:22:14+00:00 2026-06-10T09:22:14+00:00

I have a load of text boxes on an aspx page whose IDs are

  • 0

I have a load of text boxes on an aspx page whose IDs are prefixed with ‘txt’ the rest of the ID has a corresponding property of the same name in a certain object. I want to be able to enumerate through these string properties and update them where a text box of the same name (with the prefix removed) is found. Any Ideas? I know by using a Dictionary I can get around the problem but it’s not ideal.

  • 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-10T09:22:16+00:00Added an answer on June 10, 2026 at 9:22 am

    You can do that using reflection:

    MyObject data = new MyObject();
    foreach (var pi in typeof(MyObject).GetProperties().Where(i =>
                                          i.PropertyType.Equals(typeof(string)))
    {
       var control = FindControl("txt" + pi.Name) as ITextControl;
       if (control != null)
           pi.SetValue(data, control.Text, null);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using the SQL Datareader to fill the text boxes in .aspx page.
I have a wpf application which has combo box and multiple text boxes. On
Hi I have a simple aspx file with 2 text boxes and an ajax
I have a JSP Page (this is a tabbed view) with 2 text boxes,
I have a web application consisting of an aspx-file. On page load two textboxes
I currently have a load of attributes already setup as text boxes - is
I have created a jsp page in which I load a set of text
I have the scenario like this: On a page there are two text boxes
I'm trying to load text of all divs that have a particular class into
i have tried to to load the data to text box, while selecting 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.