小弟有  1个A页面。  页面上1个checkBoxList  一个按钮  A.点击钮弹出B页面
在B页面的文本框输入值   B.点击确定   这时候根据B的文本框的值要动态生成checkBoxList。 请问要怎么做?????????????急求,  小弟就这么点分 实在对不住。  
祝解答者一生平安

解决方案 »

  1.   

    都不明白你问题的重点在哪,是你要问怎么在A页面上弹出对话框样式的B。还是如何动态生成checkBoxList ?
      

  2.   

    B:
       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();
            }不知道对不, 你 试试
      

  3.   

    重点是。。 怎么在B页面 根据B文本框的值 生成A页面的checkBoxList.   
      

  4.   

    A  里面的this.textChanging  怎么调用得到啊?  也要像B那样声明吗?
      

  5.   

      在b页面 的按钮事件里面 给checkboxlist赋值
      

  6.   

    我A页面 调用不到PageHandler啊
      

  7.   

     protected void Page_Load(object sender, EventArgs e)
            {
                WebForm1 w = new WebForm1();
                w.textChanging += new WebForm1.PageHandler(w_textChanging);
            }        void w_textChanging(string text)
            {
                throw new NotImplementedException();
            }
      

  8.   

    。。蒽。 我点不出来。。 B页面点不出textChanging 
      

  9.   

      为什么只能调用到B。PageHandler  调用不到B.textChanging
      

  10.   

    WebForm1 w = new WebForm1();
      w.textChanging += new WebForm1.PageHandler(w_textChanging);你 new 一个B页面
      

  11.   

     能调用到了但是  B点确定的时候。 没走if()里面
    protected void Button1_Click(object sender, EventArgs e)
      {
      if (this.textChanging != null)
      this.textChanging(TextBox1.Text);
      }
      

  12.   

      我A 页面打开B页面的时候。  我A页面时一直在那的打开的。  不知道明不明白我的意思。?
      

  13.   

    如果我理解的没错,这个实现很简单
    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)
        {
            //......
        }
    }