我要做一个"人员选择"用户控件 由树型结构来表示
树型人员已经产生了,但是如何返选择人员的姓名到aspx文件呢?
'------------------------人员选择---------------------------------
Private Sub TreeView1_SelectedIndexChange(ByVal sender As Object, ByVal e As Microsoft.Web.UI.WebControls.TreeViewSelectEventArgs) Handles TreeView1.SelectedIndexChange
Dim NodeName, NodeType, NodeSN, ssql As String
NodeName = TreeView1.GetNodeFromIndex(TreeView1.SelectedNodeIndex).Text
NodeType = TreeView1.GetNodeFromIndex(TreeView1.SelectedNodeIndex).NodeData
If NodeType = "人员" Then
_SelectName = NodeName
Else
_SelectName = ""
End If
TreeView1.Visible = False
End Sub
这里是控件里面写的
Public _SelectName As String
Public Property SelectName() As String
Get
SelectName = _SelectName
Return SelectName
End Get
Set(ByVal Value As String)
_SelectName = Value
End Set
End Property
aspx文件
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If Page.IsPostBack Then
TextBox1.Text = PerSelect.SelectName
End If
End Sub
这样做总是出错"示引用到实例" 请各位侠帮我看一下是哪里错了?
感激不尽
[求助]用户控件问题