<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");
} }
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");
} }
-------------------------------------------
MSN:[email protected]
请给我与您交流的机会
因为它不是服务器端控件 ,同样它的点击事件也不会传入到后台只能和JS交互
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; }
实在要变通的话<a>连接到一个新页面,在page_load事件中执行操作.
也可以判断权限,不行就
alert('不具有此权限');history.back()