小弟有 1个A页面。 页面上1个checkBoxList 一个按钮 A.点击钮弹出B页面
在B页面的文本框输入值 B.点击确定 这时候根据B的文本框的值要动态生成checkBoxList。 请问要怎么做?????????????急求, 小弟就这么点分 实在对不住。
祝解答者一生平安
在B页面的文本框输入值 B.点击确定 这时候根据B的文本框的值要动态生成checkBoxList。 请问要怎么做?????????????急求, 小弟就这么点分 实在对不住。
祝解答者一生平安
解决方案 »
- c#asp sql存储过程调用的问题
- 父窗口A的超链接打开一个新窗口B,B窗口填写好信息完毕后关闭B,然后刷新A的一个DataGrid绑定事件能否实现?
- gridview 分页下面的页列表无法显示??
- 100分:asp.net 2.0的DetailsView 怎么实现开始显示时就处于输入状态
- 新装机器后的工程问题!
- VS中如果改变ASPX项目的WEB 服务器设置
- 初学者今天第一问,关于名字空间。
- 如何在.aspx中包含.htm?
- IIS的端口号和Apache冲突怎么办?
- 为什么我的C#的WebApplication放在在我的服务器上不能浏览,而本地就可以?
- 后台拼接的表格,怎么样在表格中添加服务器控件
- 动态添加验证控件问题
public delegate void PageHandler(string text); //声明委托
public event PageHandler textChanging; //声明事件
protected void Button1_Click(object sender, EventArgs e)
{
if (this.textChanging != null)
this.textChanging(TextBox1.Text);
}A:
protected void Page_Load(object sender, EventArgs e)
{
this.textChanging += new PageHandler(WebForm1_textChanging);
}
void WebForm1_textChanging(string text)
{
throw new NotImplementedException();
}不知道对不, 你 试试
{
WebForm1 w = new WebForm1();
w.textChanging += new WebForm1.PageHandler(w_textChanging);
} void w_textChanging(string text)
{
throw new NotImplementedException();
}
w.textChanging += new WebForm1.PageHandler(w_textChanging);你 new 一个B页面
protected void Button1_Click(object sender, EventArgs e)
{
if (this.textChanging != null)
this.textChanging(TextBox1.Text);
}
A页面点出B页面不成问题,关键是B页面要能回传到A页面,有两种办法:
1、定义B页面的确定按钮的PostBackUrl属性到A页面
2、点击B页面确定按钮时使用Transfer服务器方法跳转到A页面这两种方法都能使B页面提交给A页面处理,然后在A页面加载方法中使用Page的PreviousPage属性来获得回传过来的B页面的引用,但是PreviousPage属性必须强类型化为被引用的源页的类才能使用,所以你要在A页面页头使用<%@ PreviousPageType VirtualPath="~/B.aspx" %>或者@ Reference 指令指明A接受的原页属于B页面类。
然后使用类似如下代码获取B页面类并获取它其中任意控件的值
if (Page.PreviousPage != null)
{
TextBox SourceTextBox =
(TextBox)Page.PreviousPage.FindControl("TextBox1");
if (SourceTextBox != null)
{
//......
}
}