set public property in another web user control

Discussion in 'ASP .Net' started by DC Gringo, Apr 26, 2005.

  1. DC Gringo

    DC Gringo Guest

    I have two user controls in a web form...user control 1 contains just a
    label, but I want to set its value from another web user control (2) in the
    same web form. I am able to set the value from the web form, but not from
    the user control 2...what am I doing wrong?

    This is in the web form:

    <uc1:statusMessage id="StatusMessage1" runat="server"></uc1:statusMessage>

    This is in the first user control 1:

    Public theMessage As String
    Public Property statusMessage() As String
    lblStatusMessage.Text = theMessage
    End Get
    Set(ByVal Value As String)
    theMessage = Value
    End Set
    End Property

    This is in the user control 2:

    Public WithEvents statusMessage1 As statusMessage
    statusMessage1.theMessage = "No communities selected"

    DC G
    DC Gringo, Apr 26, 2005
    1. Advertisements

  2. DC Gringo

    Karl Seguin Guest

    Karl Seguin, Apr 26, 2005
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.