首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

在PlaceHolder中载入用户控件,怎么触发用户控件事件,取得用户控件内web控件的值呢

2011-12-15 
在PlaceHolder中载入用户控件,如何触发用户控件事件,取得用户控件内web控件的值呢?RT,有没有这方面的代码

在PlaceHolder中载入用户控件,如何触发用户控件事件,取得用户控件内web控件的值呢?
RT,有没有这方面的代码参考呀?

我的.aspx:


<%@   Page   Language= "VB "   Debug= "true "%>
<script   Language= "VB "   runat= "server ">
Sub   Page_Load(s   as   Object   ,   e   as   System.EventArgs)
        PlaceHolder1.Controls.Clear()  
PlaceHolder1.Controls.Add(LoadControl( "UserLogin_VB.ascx "))
End   Sub
</script>

<html>
<body>
<form   runat= "server ">
<asp:placeholder   id= "PlaceHolder1 "   runat= "server "> </asp:placeholder>  
</form>
</body>
</html>

[解决办法]
试试使用findControl来找到控件
[解决办法]
((窗口名)Context.Handler).控件名.value
[解决办法]
把用户控件中要取的值做成属性

public string sValue
{
get
{
return this.TextBox1.value;
}
}

热点排行