zoukankan      html  css  js  c++  java
  • 在ASP.net页面里取得用户控件里面的值

    一.在用户控件里添加如下代码:

    public event EventHandler gg;
      
        protected void Button1_Click(object sender, EventArgs e)
        {
            Session["ccc"] = TextBox1.Text;
          
            if (gg != null)
            {

                gg(this, e);

            }


        }

    二.在引用用户控件里的代码写入(记得要在用户控件里加入刚都声明的事件)

       如: <uc1:WebUserControl ID="WebUserControl1" runat="server" Ongg ="cc"/>

        protected void cc(object sender, EventArgs e)
        {
            if (Session["ccc"] != null)
            {
                TextBox1.Text = Session["ccc"].ToString();
                Session.Remove("ccc");
            }
        }


       本人博客的文章大部分来自网络转载,因为时间的关系,没有写明转载出处和作者。所以在些郑重的说明:文章只限交流,版权归作者。谢谢

  • 相关阅读:
    orbis 链接 .a的问题
    程序的循环结构
    程序分支控制
    字符类型及常用的函数
    数字数据类型
    基础练习
    了解计算机
    python基础练习
    markdown基本使用
    jupyterhub
  • 原文地址:https://www.cnblogs.com/wzg0319/p/1398585.html
Copyright © 2011-2022 走看看