Asp.net页面传值另类方式1:Context.Itmes

发送页面:Page1
        Context.Items["name"] = txt1.Text;
        Server.Transfer("Page2.aspx");
接受页面:Page2
     if (Context.Handler is Page1)
        {
            txt1.Value = Context.Items["name"].ToString();
        }
 
Asp.net页面传值另类方式2:Context.Handler
发送页面:Page1
        Server.Transfer("Page2.aspx");
接受页面:Page2
     if (Context.Handler is Page1)
        {
            Page1 p=(Page1)Context.Handler;
            txt1.Value =p.FindControl("txtName").Value;
        }

相关文章:

  • 2022-12-23
  • 2021-04-26
  • 2021-10-04
  • 2022-02-21
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-07-26
  • 2022-12-23
  • 2022-12-23
  • 2022-02-10
  • 2022-12-23
相关资源
相似解决方案