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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T22:59:39+00:00 2026-05-12T22:59:39+00:00

This is similar to my last post but with a different purpose. I have

  • 0

This is similar to my last post but with a different purpose.

I have built a custom control, but when I set the properties for it… ALL instances of that control on my page grab the exact same property. I need to be able to set the property to “abc” for one instance of the control on my page, and then set the exact same proprty to “xyz” for a different instance of the control on the same page.

Can anyone shed any light?

Namespace CustomControl
Public Class mycontrol : Inherits Literal
    Protected Overrides Sub CreateChildControls()
        Dim value As String = "test"
        If _doubleit = True Then
            value = value & " test"
        End If

        MyBase.Text = value
        MyBase.CreateChildControls()
    End Sub

    Private Shared _doubleit As Boolean = True
    Public Shared Property doubleit() As Boolean
        Get
            Return _doubleit
        End Get
        Set(ByVal value As Boolean)
            _doubleit = value
        End Set
    End Property
End Class

End Namespace

  • 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-12T22:59:40+00:00Added an answer on May 12, 2026 at 10:59 pm

    Remove the Shared from your variable and from your property declaration. Shared means exactly that what you don’t want: All instances share the same value.

    So, your code should look like this:

    Private _doubleit As Boolean = True
    Public Property doubleit() As Boolean
        Get
            Return _doubleit
        End Get
        Set(ByVal value As Boolean)
            _doubleit = value
        End Set
    End Property
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Although it is looking similar to my previous post but here purpose is different.
I have checked this similar question, but the suggestions did not solve my problem:
This is similar to (but different from) this question . Here is some simple
This is similar to this question I asked last week. My dataGrid is populated
I found this similar question here , but this is really old. Was it
(this is similar to GNU make: Execute target but take dependency from file but
we've implemented a system similar to the one described in this other SO post
I would normally post this on nvidia's developer forums but they are still offline
I have asked a couple of similar questions the last couple of days and
I post this here as a last resort. I'm completely stuck and do not

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.