喜IM上有一個數據庫如何爲不同的用戶提供不同的登錄頁面?
UserName|Password|UserType
Anil|Anil|Manager
ghouse|Ghouse|Admin
raghu|raghu|User
現在我的任務是在登錄時每個用戶提供他們自己的網頁....它們都具有相同的登錄頁面的Web應用程序的工作..
能任何1分幫助我....
傢伙我想這代碼的wotkin罰款,兩個用戶可以在任何1告訴我該怎麼做,如果我有兩個以上的用戶
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();
if (TypeUser != null)
{
LblError.Visible = false;
LblError.Text = "";
if (TypeUser.ToString() == "Manager")
Response.Redirect("~/CallingAgents/CallingAgents_Login.aspx");
else
Response.Redirect("~/UserRegistrationForm.aspx");
}
else
{
LblError.Visible = true;
LblError.Text = "Invalid Credentials Entered, Try again";
}
難道真的特定用戶或用戶類型的具體點嗎? – Mithrandir 2012-02-13 09:51:11
usertype @Mithrandir – SoftwareNerd 2012-02-13 09:52:44
任何1可以幫助我的代碼.. – SoftwareNerd 2012-02-13 10:22:21