可以将选中的ID通过SESSION或隐藏控件等其他方法传到下一页面

解决方案 »

  1.   

    可以用javascript来实现,关键语句是:在事件函数中用location.href="xx.aspx?id="+取得的复选框值。这样就可以把参数传到相应的页面了
      

  2.   

    定义一个public static 的变量在页面1中给这个变量赋值为你要的id值,在页面2中读取这个值
      

  3.   

    怎么给变量赋值,是这样吗?
    private String  tempid; public string getjobid 

    get 

    return tempid; 

    }
      

  4.   

    比如,你在class1中定义了一个public static int id;
    你要在class2中赋值
            class1.id=.....
    然后在class3中要用到这个值
    int id=class1.id
      

  5.   

    大帅哥,你能帮我看看这个程序对吗?
    有四个文件: page1.aspx ,page1.aspx.cs, page2.aspx, page2.aspx.cspage1.aspx<%@ Page Language="C#" Inherits="page.pageone"  Src="page1.aspx.cs"%>
    <html>
    <head>
    </head>
    <body>
    <form runat="server">
    First Name:
    <asp:TextBox id="first" runat="server" />
    <br>
    Last Name:
    <asp:TextBox id="last" runat="server" />
    <br>
    <asp:Button id="Button1" Text="Go to second page" runat="server" OnClick="ButtonClicked" />
    </form>
    </body>
    </html>
    -----------------------------
    page1.aspx.csusing System;
    namespace page{public class pageone : System.Web.UI.Page
    {
       protected System.Web.UI.WebControls.TextBox first;
       protected System.Web.UI.WebControls.TextBox last;
       protected System.Web.UI.WebControls.Button Button1;
       private String  tempstr;   public string FirstName 
       { 
          get 
          { 
             return tempstr; 
          } 
       }   public string LastName 
       { 
          get 
          { 
             return last.Text; 
          } 
       }   public void ButtonClicked(object sender, EventArgs e) 
       { 
            tempstr=first.Text;
    Response.Redirect("page2.aspx");
       }}
    }----------------------
    page2.aspx<%@ Page Language="C#" Inherits="page.pagetwo"  Src="page2.aspx.cs"%>
    <html>
    <head>
    </head>
    <body>
    <form runat="server">

    </form>
    </body>
    </html>
    -------------------------------
    page2.aspx.csusing System;
    namespace page
    {
    public class pagetwo : System.Web.UI.Page
    {   protected System.Web.UI.WebControls.Label DisplayLabel;
        void Page_Load() 
       {
          if (!IsPostBack)
          {  pageone fp=new pageone();
              Response.Write(fp.FirstName);
          } 
       }}
    }为什么运行的时候,报错:找不到类型或命名空间名称“pageone”(是否缺少 using 指令或程序集引用?)
    呢?
    是不是要编译成dll?
      

  6.   

    pageone fp=new pageone();
    你这样写应该是不行的。new pageone()实际上是调用pageone类的构造方法,而你在pageone类中根本没有这个方法呀
      

  7.   

    你在pageone类中加个public pageone()
    {}试试
      

  8.   

    你这样写
      page.pageone nf=new page.pageone();