<a href="test.aspx" target="right">工作安排</a>点击 “工作安排” 就会相应一个类似button的事件
protected void Button1_Click(object sender, EventArgs e)
    {
        string sss = "  select sum(cast(c.ischeck  as   tinyint))as summ ,count (*) as countt    from roleright a inner join RoleRight b ON A.Funname = '学员编班' AND b.FunListType = A.FunId  inner join usertypefun c on c.funid = a.funid and c.usertype = '" + Session["branch"].ToString()+"'";
   
        OleDbConnection Connection1 = DBClass.Conn();
        Connection1.Open();
        OleDbCommand mycommand = new OleDbCommand(sss, Connection1);
        OleDbDataReader myreader = mycommand.ExecuteReader();
        if (myreader.Read())
        {
            Session["summ"] = myreader["summ"];
            Session["countt"] = myreader["countt"];
            Page.Response.Redirect("test.aspx");
        }    }

解决方案 »

  1.   

    为什么不用<asp:LinkButton
      
    -------------------------------------------
    MSN:[email protected] 
    请给我与您交流的机会
      

  2.   

    <a href="test.aspx" target="right">工作安排</a>
    因为它不是服务器端控件 ,同样它的点击事件也不会传入到后台只能和JS交互
      

  3.   

    asp 和 javascript我也不会呀,愁死我了!!!
      

  4.   

    <a href="test.aspx" target="right" onclick="__doPostBack(this,'')">工作安排</a>
      

  5.   

    <a href="test.aspx" target="right" onclick="">送达方</a>
      

  6.   

    那个__doPostBack(this,'')怎么用啊,要实现
    string sss = "  select sum(cast(c.ischeck  as   tinyint))as summ ,count (*) as countt    from roleright a inner join RoleRight b ON A.Funname = '学员编班' AND b.FunListType = A.FunId  inner join usertypefun c on c.funid = a.funid and c.usertype = '" + Session["branch"].ToString()+"'";
       
            OleDbConnection Connection1 = DBClass.Conn();
            Connection1.Open();
            OleDbCommand mycommand = new OleDbCommand(sss, Connection1);
            OleDbDataReader myreader = mycommand.ExecuteReader();
            if (myreader.Read())
            {
                Session["summ"] = myreader["summ"];
                Session["countt"] = myreader["countt"];
                Page.Response.Redirect("test.aspx");
            }在点击事件中实现判断权限怎么写
            int sum =  Convert.ToInt32( Session["summ"].ToString());
            int countt =Convert.ToInt32( Session["countt"].ToString());
            if(sum == 0)
            {
                MessageBox.Show("对不起,您不具有此权限");
                return;        }
      

  7.   

    我还是用LinkButton做吧!!!谢谢大家,我学到不少!!!
      

  8.   

    不知道lz说的为了统一是什么意思?
    实在要变通的话<a>连接到一个新页面,在page_load事件中执行操作.
    也可以判断权限,不行就
    alert('不具有此权限');history.back()