我在两个页面中用Context.Handler来传递参数,在a页面中使用了如下语句:
admin_userlist au;//引用页面
au = (admin_userlist)Context.Handler;
  if (!IsPostBack)
  {
    ……
    string cc = au.bb;
  }
当从b页面中点击按钮进入a页面时,能正确的实现参数的传递;可是当独立打开a页面时就出错了。简单的说就是单独打开含有:page aa; aa = (page)Context.Handler; 语句的页面就会报错,这是为什么啊?但我又一定需要使用能独立打开的a页面。百思不得其解啊,由于太晚明天还要工作,所以只能先把问题放这儿寻求大家的帮助了。先真诚的感谢各位了!!!附出错提示:
Server Error in '/col_search' Application.
--------------------------------------------------------------------------------Specified cast is not valid. 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.InvalidCastException: Specified cast is not valid.Source Error: 
Line 46:  // Put user code to initialize the page here
Line 47:  admin_userlist au;//引用页面
Line 48:  au = (admin_userlist)Context.Handler;
Line 49:  if (!IsPostBack)
Line 50:  {
 Source File: c:\Inetpub\wwwroot\col_search\webadmin\admin_userinsert.aspx.cs    Line: 48 Stack Trace: 
[InvalidCastException: Specified cast is not valid.]
   col_search.admin_userinsert.Page_Load(Object sender, EventArgs e) in c:\Inetpub\wwwroot\col_search\webadmin\admin_userinsert.aspx.cs:48
   System.Web.UI.Control.OnLoad(EventArgs e)
   System.Web.UI.Control.LoadRecursive()
   System.Web.UI.Page.ProcessRequestMain()