こんにちは...私はマスターページを持っている......どのように特定のユーザーのためのメニューを非表示にするには? thierログインタイプに基づいて、特定のユーザーのために特定のメニューを非表示にするには、どのように
1)I have four Main users
2)Each user is redirected his own page on login.
何私がしたいことは、私はすべてのユーザーのためのいくつかのメニューを非表示にしたいです
1)if Manager logins only his required menu should be shown to him,this menu shouldn't be avaliable to other users
thierログインタイプに基づいて、私のログインコードは、この
protected void btnLogin_Click(object sender, EventArgs e)
{
//Response.Redirect("~//Administration/DashBoard.aspx");
SqlConnection con = new SqlConnection("Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=DebitCareBankApp;Data Source=SSDEV7-HP\\SQLEXPRESS");
string cmdStr = "select LoginType from Login where UserName='" + TxtUserName.Text + "' AND Password = '" + TxtPassword.Text + "'";
SqlCommand cmd = new SqlCommand(cmdStr, con);
con.Open();
Object TypeUser = cmd.ExecuteScalar();
con.Close();
//int switchcase = int.Parse(TypeUser);
if (TypeUser != null)
{
LblError.Visible = false;
LblError.Text = "";
if (TypeUser.ToString() == "Manager")
{
Response.Redirect("~//Administration/Manager/WorkManagement.aspx");
}
else if (TypeUser.ToString() == "HR")
{
Response.Redirect("~//Administration/Hr/CalculateAndGeneratePayslips.aspx");
}
else if (TypeUser.ToString() == "Employee")
{
Response.Redirect("~//Administration/CallingAgent/TodaysWork.aspx");
}
}
else
{
LblError.Visible = true;
LblError.Text = "Invalid Credentials Entered, Try again";
}
}
メニューの作成方法は?それを行うにはUserControlを使用していますか?または、手動でメニューを作成する各ページで? –