R
R.A.M.
Hello,
I have a problem with unexpected Application_Erro().
I have ASP.NET application with start page Default.aspx containg
<asp
laceHolder ID="Place" runat="server" />
for custom login control.
Here is Default.aspx.cs:
public partial class DefaultPage : System.Web.UI.Page
{
class DemoLogin : Login
{
public DemoLogin(string ID) : base()
{
this.ID = ID;
DestinationPageUrl = "Welcome.aspx";
TitleText = "<b>Logging in</b>";
UserNameLabelText = "User";
PasswordLabelText = "Password";
PasswordRequiredErrorMessage = "Password required.";
LoginButtonText = "Login";
LoginButtonType = ButtonType.Button;
RememberMeSet = true;
RememberMeText = "Remeber";
InstructionText = "<i>Enter any username and password
\"demo\".</i>";
FailureText = "Failure. Try again.";
}
override protected void OnAuthenticate(AuthenticateEventArgs
e)
{
e.Authenticated = (UserName != "" && Password == "demo");
}
}
private void Page_Load(object sender, EventArgs e)
{
Browser.Text = Request.Browser.Browser + " " +
Request.Browser.Version;
Platforma.Text = Request.Browser.Platform;
Place.Controls.Add(new DemoLogin("Login"));
Session["User"] = Application["Users"];
}
}
PROBLEM: After running Page_Load I receive infinite sequence of
unexpected Application_Error() and then Session_Start().
Here is Global.asax:
<script runat="server">
void Application_Start(object sender, EventArgs e)
{
Application["Users"] = 0;
}
void Application_End(object sender, EventArgs e)
{
Application["Users"] = 0;
}
void Application_Error(object sender, EventArgs e)
{
Response.Redirect("Problem.html");
}
void Session_Start(object sender, EventArgs e)
{
Application.Lock();
Application["Users"] = Convert.ToInt32(Application["Users"]) +
1;
Application.UnLock();
}
void Session_End(object sender, EventArgs e)
{
Application.Lock();
Application["Users"] = Convert.ToInt32(Application["Users"]) -
1;
Application.UnLock();
}
</script>
The problem appeared a few days ago, application has been working for
a few months without problem, I changed nothing.
Could you explain me the problem plase?
Thank you very much!
/RAM/
I have a problem with unexpected Application_Erro().
I have ASP.NET application with start page Default.aspx containg
<asp
for custom login control.
Here is Default.aspx.cs:
public partial class DefaultPage : System.Web.UI.Page
{
class DemoLogin : Login
{
public DemoLogin(string ID) : base()
{
this.ID = ID;
DestinationPageUrl = "Welcome.aspx";
TitleText = "<b>Logging in</b>";
UserNameLabelText = "User";
PasswordLabelText = "Password";
PasswordRequiredErrorMessage = "Password required.";
LoginButtonText = "Login";
LoginButtonType = ButtonType.Button;
RememberMeSet = true;
RememberMeText = "Remeber";
InstructionText = "<i>Enter any username and password
\"demo\".</i>";
FailureText = "Failure. Try again.";
}
override protected void OnAuthenticate(AuthenticateEventArgs
e)
{
e.Authenticated = (UserName != "" && Password == "demo");
}
}
private void Page_Load(object sender, EventArgs e)
{
Browser.Text = Request.Browser.Browser + " " +
Request.Browser.Version;
Platforma.Text = Request.Browser.Platform;
Place.Controls.Add(new DemoLogin("Login"));
Session["User"] = Application["Users"];
}
}
PROBLEM: After running Page_Load I receive infinite sequence of
unexpected Application_Error() and then Session_Start().
Here is Global.asax:
<script runat="server">
void Application_Start(object sender, EventArgs e)
{
Application["Users"] = 0;
}
void Application_End(object sender, EventArgs e)
{
Application["Users"] = 0;
}
void Application_Error(object sender, EventArgs e)
{
Response.Redirect("Problem.html");
}
void Session_Start(object sender, EventArgs e)
{
Application.Lock();
Application["Users"] = Convert.ToInt32(Application["Users"]) +
1;
Application.UnLock();
}
void Session_End(object sender, EventArgs e)
{
Application.Lock();
Application["Users"] = Convert.ToInt32(Application["Users"]) -
1;
Application.UnLock();
}
</script>
The problem appeared a few days ago, application has been working for
a few months without problem, I changed nothing.
Could you explain me the problem plase?
Thank you very much!
/RAM/