我有Gridview的绑定sqldatasource和我有登录看到gridview和我做这些登录的角色他们不能看到所有的gridview列,所以我怎么能让一些列只能读取。只读的GridView中的列
代码 公共无效CheckLoginAuthorty(){
using (SqlConnection Con = Connection.GetConnection())
{
SqlCommand com = new SqlCommand("CheackLoginInRole", Con);
com.CommandType = CommandType.StoredProcedure;
com.Parameters.Add(Parameter.NewNVarChar("@Login", Session.Contents["Username"].ToString()));
object O = com.ExecuteScalar();
if (O != null)
{
string S = O.ToString();
if (IsInRole("AR-Translator", O.ToString()))
{
///////// Grideview code/////////////////
}
else if (IsInRole("EN-Translator", O.ToString()))
{
/////////Grideview code/////////////////
}
}
}
}
你要隐藏一些列或公正也不对其进行编辑? – Arseny 2010-07-27 11:50:40
我想根据用户的角色只读取特定列 – Myworld 2010-07-27 11:53:39