【发布时间】:2010-11-04 14:28:31
【问题描述】:
尝试从我的用户控件上的父页面访问属性。
这是我的 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 的成员”
请原谅!
【问题讨论】: