[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 196
  • Last Modified:

using usercontrol


hi

      i have a usercontrol which has public property description. how can i access that property in .aspx page.

Initially i have dragged and dropped the user control onto .aspx page.

when i am writing code in .aspx.vb file as

                Label1.Text = Bccbc1.Description (Bccbc1 is the usercontrol and description is the property of it)

it giving me error as " Reference to a non-shared member requires an object reference."

any help with this.

thanks
     
0
srinivas_vemla
Asked:
srinivas_vemla
2 Solutions
 
RonaldBiemansCommented:
It look likes the usercontrol wasn't instanciated

dim bccbc1 as NEW yourusercontrol

does your usercontrol

include this


Public Sub New()
        MyBase.New()

        'This call is required by the Windows Form Designer.
        InitializeComponent()

        'Add any initialization after the InitializeComponent() call

    End Sub
0
 
123654789987Commented:
Have u put the following on top of your inheriting asmx page

<%@ control inherits = "YourUserControl" src = "YourUserControl.cs" %>
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now