Blogs.aspx.cspublic class Blogs : System.Web.UI.Page
{
private void Page_Load(object sender, System.EventArgs e)
{
//添加用户控件;
this.Controls.Add(LoadControl("user.ascx"));
}
public void TxtShow()
{
//向页面中添加一些东西
}
}user.ascx.cs public class UserAddText : System.Web.UI.UserControl
{
protected System.Web.UI.WebControls.Button Button1;
private void Button1_Click(object sender, System.EventArgs e)
{
//就是这样,如何在这里执行Blogs的TxtShow()方法?
}}问题就是这样了,如何做呢,是不是用委托,但我不会用,谁能详细说一下??另外,不要给我变通的方法来实现,我必须要这样实现。
拜托了,在线等;
{
private void Page_Load(object sender, System.EventArgs e)
{
//添加用户控件;
this.Controls.Add(LoadControl("user.ascx"));
}
public void TxtShow()
{
//向页面中添加一些东西
}
}user.ascx.cs public class UserAddText : System.Web.UI.UserControl
{
protected System.Web.UI.WebControls.Button Button1;
private void Button1_Click(object sender, System.EventArgs e)
{
//就是这样,如何在这里执行Blogs的TxtShow()方法?
}}问题就是这样了,如何做呢,是不是用委托,但我不会用,谁能详细说一下??另外,不要给我变通的方法来实现,我必须要这样实现。
拜托了,在线等;
解决方案 »
- 求助 子夜 孟子等高手mvc 3.0 中使用ckeditor 提交数据时出错
- 公司项目出大问题了,跪求高手来解决!急急急!!!
- 请大家帮助,写个sql语句 一列多行,合并成一列一行
- 进度条跟数据库交互~~~~
- Substring截取字符串的问题
- DotNetNuke_04.08.00_StarterKit.vsi安装成功后在vs2005(sp1)选择File|New Web Site 后,在my templates 中没有Dotnetnuke Web Application Framework模版
- GridView中的checkbox的问题
- 学习asp.net,大家请进
- 如何实现论坛中的新帖提示功能?
- 思归高手请进!有关IFRAME的,我没分了
- 解决方案,打开里面的文件.出错....请高手指点!!!(WEB窗体设计器未能加载该文件)
- 怎样写button的服务器端代码,实现打开一个新的页面,而且不关掉当前页面?
((Blogs)Page).TextShow();But you cannot use this usercontrol on the other page.
The components should know nothing about its parent.