J
jelle.huygen
Hello,
I've worked on a website in ASP.NET 2.0 where, on every page, login-
button of a login control is set as the default button. The login-
control is on the masterpage of the website. In the prerender-method
of the masterpage, I have placed the following code:
Login lg = (Login)lgView.FindControl("lgLogin");
if (lg != null)
{
Button btn = (Button)lg.FindControl("LoginButton");
if (btn != null)
Page.Form.DefaultButton = btn.UniqueID;
}
The website is running in a production environment and a couple of
times a day we get the following exception:
The DefaultButton of 'form1' must be the ID of a control of type
IButtonControl
I can't reproduce the exception; it appearce to occure randomly.
Does anyone experienced the same problem or does anyone have a
solution?
Kind regards,
Jelle
I've worked on a website in ASP.NET 2.0 where, on every page, login-
button of a login control is set as the default button. The login-
control is on the masterpage of the website. In the prerender-method
of the masterpage, I have placed the following code:
Login lg = (Login)lgView.FindControl("lgLogin");
if (lg != null)
{
Button btn = (Button)lg.FindControl("LoginButton");
if (btn != null)
Page.Form.DefaultButton = btn.UniqueID;
}
The website is running in a production environment and a couple of
times a day we get the following exception:
The DefaultButton of 'form1' must be the ID of a control of type
IButtonControl
I can't reproduce the exception; it appearce to occure randomly.
Does anyone experienced the same problem or does anyone have a
solution?
Kind regards,
Jelle