| Author: Praveen 29 Aug 2008 | Member Level: Gold | Rating: Points: 4 |
<authentication mode="Forms" > <forms loginUrl="login.aspx" timeout="30" /> </authentication> <authorization> <deny users="?" /> </authorization>
Comment this lines in ur web.config
i hope this will help u
|
| Author: Legend 29 Aug 2008 | Member Level: Silver | Rating: Points: 6 |
ok, first you can check your system username and , if can fetch the user name and you no need to run the login form,
you can fetch the user name like
string UserName = ""; UserName = User.Identity.Name; if (Convert.ToInt32(UserName.IndexOf("\\")) > 0) { UserName = UserName.Remove(0, Convert.ToInt32(UserName.IndexOf("\\") + 1)); } Session["get"] = UserName;
and ADD the new empty form(Write the below code into that form(dont put any controls))
//Dataset here(that is connection to DATABASE) if (ds != null) { if (ds.Tables.Count > 0) { if (ds.Tables[0].Rows.Count > 0) { DataRow Rw = ds.Tables[0].Rows[0]; if (Rw != null) { Session["AccessType"] = Rw["Fk_AccessType"].ToString(); UserAvailable = true; }
} } }
if (UserAvailable) { if ((Session["AccessType"].ToString()) == "3") { Response.Redirect("Helpdesk_EmployeeRequestDetails.aspx"); } else if ((Session["AccessType"].ToString()) == "2") { Response.Redirect("Helpdesk_Assign.aspx"); } else if ((Session["AccessType"].ToString()) == "1") { Response.Redirect("Helpdesk_Assign.aspx"); }
} else { // if ((Session["AccessType"].ToString()) != "1" || (Session["AccessType"].ToString()) != "2" || (Session["AccessType"].ToString()) != "3") //{ Response.Redirect("Helpdesk_Endpage.aspx");//This is page displys(User is not authorised person to view this page) // } }
Thanks , is this helpful? if it is helpful, reply how it is?
|
| Author: raghunath 29 Aug 2008 | Member Level: Bronze | Rating: Points: 0 |
login.txt |