比如从test1.aspx页面点击按钮进入test2.aspx页面,如果想在test2.aspx页面中得到test1.aspx页面中某些控件的值.

test1.aspx前台代码,  这里要注意的按钮一定要设置postbackurl="test2.aspx" 属性,不能在它的CS代码中比如用Redirect 的方法

test1.aspx.cs      //这个页面没写代码





test2.aspx 前台代码   //这里也没写什么东东
test2.aspx.cs

在test2.aspx.cs 代码中使用类似((TextBox)this.PreviousPage.FindControl("TextBox1")).Text 的方法来访问前页的属性或方法.

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-08-04
  • 2021-12-22
  • 2022-03-01
  • 2022-12-23
  • 2022-12-23
  • 2022-02-15
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-01-14
  • 2022-12-23
相关资源
相似解决方案