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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T12:42:53+00:00 2026-06-09T12:42:53+00:00

I have an aspx web form with various inputs including a dropdown box with

  • 0

I have an aspx web form with various inputs including a dropdown box with 1-10. When the form is submitted a new panel is visible that has 10 rows of static textbox and label controls. These controls are all set to visible=false by default.

What I want is based on the number selected in the previous dropdown box, that is how many rows of controls I want to change to visible=true. The IDs for these controls are the same for each row apart from the last character which is to reflect what row they belong to. So row 1 would have the following:

ticketNum_Lbl_1
your_res_Txt_1
title_Txt_1
firstname_Txt_1
surname_Txt_1
ticketNum_Txt_1

What I wanted was a simple loop that would check the number at the end of the control’s ID and compare that to the number selected in the dropdown.

For clarity the dropdown list is for a user to select how many seats at a table they would like to book, the following screen would let them allocate names to the seats they are booking.

I have tried several things but am still obviously not getting it, although it might be something along the lines of:

    Dim rowsNeeded As Integer = number_of_tickets_Ddl.SelectedValue
        For a = 1 To rowsNeeded
        Me.Controls("ticketNum_Lbl_" & a).Visible = True
        Me.Controls("your_res_Txt_" & a).Visible = True
        Me.Controls("title_Txt_" & a).Visible = True
        Me.Controls("firstname_Txt_" & a).Visible = True
        Me.Controls("surname_Txt_" & a).Visible = True
        Me.Controls("ticketNum_Txt_" & a).Visible = True

    Next

But this comes up with an error as the controls reference an index (integer) rather than a control’s name or ID (it seems?).

Any help appreciated.

  • 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-09T12:42:55+00:00Added an answer on June 9, 2026 at 12:42 pm

    You should use FindControl

    Me.FindControl("ticketNum_Lbl_" & a).Visible = True
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an aspx web form in a WCF service project that gives a
I currently have a web form aspx page that calls RegisterClientScriptBlock. This sends down
I have a huge ASPX web form which has around 100 fields which need
I have a control that can be placed in a Web form (.aspx) or
I have a web form page Default.aspx, which inherits from a BasePage class that
I have a .aspx Web Form with a .aspx.cs code-behind. The code-behind is nearly
my structure is like this: master page aspx(web form) ascx(user control) I have a
I am new to web development. I have 2 .aspx files and in default
I have a web page (.aspx) that calls a third party web service to
I have many aspx page includes in my web form. I want to convert

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.