I am working on a web application. Can someone help me to redirect after login using Response.Redirect
I tried any solutions that i have seen on the internet but no solutions worked for me.
Cant fix this problem since I started 2 weeks ago.
public void checkSessionIfNull(string location) {
try
{
location = "../examples/login.html";
if (HttpContext.Current.Session[AppUser] != null){
HttpContext.Current.Response.RedirectPermanent(location,false);
HttpContext.Current.ApplicationInstance.CompleteRequest();
}
else{
returntoLoginIfSessionisNull(HttpContext.Current.Session[AppUser]);
}
}catch (ThreadAbortException ex1){
Console.WriteLine(ex1.Message.ToString());
}catch (Exception ex) {
Console.WriteLine(ex.Message.ToString());
}
}
Thanks , Regardds