如何从html访问usercontrol中的正确性

时间:2016-10-11 13:16:36

标签: asp.net vb.net

我在用户控件中有公共属性,我需要从HTML访问此属性以获取此用户控件的父级

Public Property ActorID As Integer
    Set(value As Integer)
        ViewState("ActorID") = value
    End Set
    Get
        Return ViewState("ActorID")
    End Get
End Property


<uc3:Hos_Applicants ID="Hos_Applicants1" runat="server" />

1 个答案:

答案 0 :(得分:0)

<uc3:Hos_Applicants ID="Hos_Applicants1" runat="server" ActorID="2" />

您可以从父asp页面访问属性并在用户控件中设置值