尝试从我的用户控件上的父页面访问属性.
这是我的default.asp代码隐藏的开始:
- Partial Class _Default
- Inherits System.Web.UI.Page
- Private _selectedID As String = "74251BK3232"
- Public Property SelectedID() As String
- Get
- Return _selectedID
- End Get
- Set(ByVal value As String)
- _selectedID = value
- End Set
- End Property
- Partial Class ctrlAddAttribute
- Inherits System.Web.UI.UserControl
- Dim selectedID As String = Me.Parent.Page.selectedID()
我收到错误“selectedID不是System.Web.UI.Page的成员”
请adivse!