View Single Post
 
Old June 29th, 2005, 12:07 PM
dhmderuiter dhmderuiter is offline
Registered User
 
Join Date: Jun 2005
Location: , , .
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Based on the above I have a question... How do you use the public property from the user control in the parent webform?

In the user control I have:

Private Viewmodevalue As String = ""
Public Property Viewmode() As String
  Get
    Return Viewmodevalue
  End Get
  Set(ByVal Value As String)
    Viewmodevalue = Value
  End Set
End Property

I can set the value in the parent webform using:

Public Class Home
    Public Top

    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)
        Top.Viewmode = "2"
    End Sub

End Class

First, is this the good method to set a public propery?

Second, how do I get/retrieve the public property value in the parent webform (if I want to use it on another place, or if I have set the property in the webcontrol, but want to retrieve it in the parent webform)?

Third, can I also set and get the public property from the user conrol in another user control?

Thanks in advance! Martin