S
savvy
I able to redirect the user to the index.aspx page after every
successful login, but I dont want certain pages outside the folder to
have a access to general public. So if they click that particular link
or button i want them to be re-directed to the login page and after
successful login i want to them to view the requested page.
Can i redirect the users to the login page using
Reponse.Redirect("js/login.aspx");
in the button click event? or is there any other way?
how we can we get the url so that i can transfer to the respective
page?
I know we should use FormsAuthentication.SetAuthCookie of
FormAuthentication.GetredirectUrl for this purpose but i dont have any
idea how this works.
Any ideas will be greatly appreciated
At the moment i'm using this code
private void btnlogin_Click(object sender, System.EventArgs e)
{
bool blnAuthentication =
Authenticate(txtusername.Text,txtpassword.Text);
if(blnAuthentication)
{
FormsAuthentication.RedirectFromLoginPage(txtusername.Text,false);
Session["isMemberLoggedIn"]= true;
Response.Redirect("index.aspx");
}
else
{
Session["isMemberLoggedIn"]= false;
lblErr.Text = "Your Login was invalid. Please try
again.";
}
}
successful login, but I dont want certain pages outside the folder to
have a access to general public. So if they click that particular link
or button i want them to be re-directed to the login page and after
successful login i want to them to view the requested page.
Can i redirect the users to the login page using
Reponse.Redirect("js/login.aspx");
in the button click event? or is there any other way?
how we can we get the url so that i can transfer to the respective
page?
I know we should use FormsAuthentication.SetAuthCookie of
FormAuthentication.GetredirectUrl for this purpose but i dont have any
idea how this works.
Any ideas will be greatly appreciated
At the moment i'm using this code
private void btnlogin_Click(object sender, System.EventArgs e)
{
bool blnAuthentication =
Authenticate(txtusername.Text,txtpassword.Text);
if(blnAuthentication)
{
FormsAuthentication.RedirectFromLoginPage(txtusername.Text,false);
Session["isMemberLoggedIn"]= true;
Response.Redirect("index.aspx");
}
else
{
Session["isMemberLoggedIn"]= false;
lblErr.Text = "Your Login was invalid. Please try
again.";
}
}