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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T05:27:10+00:00 2026-05-27T05:27:10+00:00

Apologies if this is something really simple. I’ve found various C# examples here, but

  • 0

Apologies if this is something really simple.

I’ve found various C# examples here, but I can’t seem to get a VB version working.

I want to be able to pass a simple variable into a User Control to determine whether it shows a certain section of data.

It’s basically a Customer Data form, and in some circumstances I need to show a line with the customers account number and sort code, and in some I don’t, so my user control:

<controls:customerForm ID='customerForm' showBankDetails="no" runat='server' />

But I can’t work out what to do with the showBankDetails variable in Code Behind to stop it from rendering that section, or simply hide it with a CSS snippet.

How do I access that variable in the code behind using VB.NET?

  • 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-27T05:27:10+00:00Added an answer on May 27, 2026 at 5:27 am

    Normally I’d have optional stuff in a asp:panel on the page in the right spot, and in the page load or where ever, do something like:

    me.OptionalStuffPanel.Visible = me.ShowBankDetails
    

    ShowBankDetails would need to be defined as a public property of the page class:

    private _ShowBankDetails as boolean
    Public Property ShowBankDetails() As boolean
        Get
            Return _ShowBankDetails
        End Get
        Set(ByVal value As boolean)
            _ShowBankDetails = value
        End Set
    End Property
    

    If you want the property to appear in the property grid here is an article to show you how!

    http://www.codeproject.com/KB/vb/using_propertygrid.aspx

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

Sidebar

Related Questions

Sorry if this question may be simple, but I can't seem to find an
Apologies if this was already asked but, I have had a look and can't
I'm fairly new to Rspec so apologies if this is a really simple question:
Apologies if this is a slightly noob question, but looking to clarify my thoughts
Apologies if this is a dumb question but I'm trying to format a currency
Apologies for this question but I am a bit of a noob with Delphi.
I am looking to do something really simple. Merely convert a string, such as
My apologies if this is too basic. I'm really not looking for someone to
This is probably a really stupid newbie-sounding question to you developer type people, but
I may just be missing something obvious here, so I apologize if this is

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.