I am in the process of coding a web application with asp.net. The users enter their credentials and these are validated against the actual email address and password for authorization. I wrote some classes for processing these data (in a seperate .cs file).
public static class Login
{
public static void LoginFirstTime(string Email, string Password)
{
//This method logs the user in for the first time after he has registered.
Response.Redirect("UserPage.aspx", true);
//After logging in, the user will be redirected to his personal page.
}
}
However I seem not to be able to access the Response.Redirect() method from inside the Login class which is in the seperate cs file. (I can access it from inside the event handlers I wrote for the aspx page.) Does anyone have an idea? Thank you in advance for helping!
Try using the full namespace:
public static void LoginFirstTime(string Email, string Password)
{
//This method logs the user in for the first time after he has registered.
HttpContext.Current.Response.Redirect("UserPage.aspx", true);
//After logging in, the user will be redirected to his personal page.
}