标题:[求助]用户控件问题
取消只看楼主
evilfeng
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2006-9-13
 问题点数:0 回复次数:0 
[求助]用户控件问题

我要做一个"人员选择"用户控件 由树型结构来表示
树型人员已经产生了,但是如何返选择人员的姓名到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

这样做总是出错"示引用到实例" 请各位侠帮我看一下是哪里错了?

感激不尽

搜索更多相关主题的帖子: 控件 用户 
2006-09-28 13:18



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-93486-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.090755 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved