Hi,
OnAuthenticate is used to implement a custom authentication scheme.
Do you want to simply hardcode username and password in your web application?
string UserName = "szmitek";
string Password = "password";
If so, you can try following:
private
void OnAuthenticate(object sender, AuthenticateEventArgs e)
{
bool Authenticated = false;
string UserName = "szmitek";
string Password = "password";
if((Login1.UserName == UserName) && (Login1.Password == Password))
Authenticated = true;
e.Authenticated = Authenticated;
}
And on user login:
protected void Login1_OnLoggedIn(object sender, EventArgs e)
{
Response.Redirect("admin.aspx");
}