Oct 10, 2008, 10:41 AM
AjaxEvents From CodeBehind
Hi Everybody,
I'm having some troubles building my application interface completely from codebehind.
First, I post the incriminated code:
The Login Window display correctly inside the page with the Login button inside it.
Pressing the button the Event Mask display but after 1 second a runtime error appears inside an ext error window saying:
Server Error in '/' Application.
System.Web.HttpException: The control with ID 'ButtonLogin' not found
Does somebody know the possible cause of this error?
Help Please
Thanks....
Andrea Cammarata WebSite
I'm having some troubles building my application interface completely from codebehind.
First, I post the incriminated code:
(some code here...)
....
public Coolite.Ext.Web.Button GetLoginButton()
{
/*--------------------------------------
* Button Login Creation
* -------------------------------------*/
if (this.btnLogin == null)
{
Coolite.Ext.Web.Button ButtonLogin = new Coolite.Ext.Web.Button();
ButtonLogin.ID = "ButtonLogin";
ButtonLogin.Text = "Login";
ButtonLogin.Icon = Icon.Accept;
ButtonLogin.AjaxEvents.Click.Event += new ComponentAjaxEvent.AjaxEventHandler (ButtonLogin_Click);
ButtonLogin.AjaxEvents.Click.EventMask.ShowMask = true;
ButtonLogin.AjaxEvents.Click.EventMask.Msg = "Wait...";
ButtonLogin.AjaxEvents.Click.EventMask.MinDelay = 1000;
this.btnLogin = ButtonLogin ;
}
return(this.btnLogin);
}
protected void ButtonLogin_Click(object sender, AjaxEventArgs e)
{
// Do Something....
}
protected void Page_Load(object sender, EventArgs e)
{
// Add The Login Window that it contains the Login Button
this.formMain.Controls.Add(GetLoginWindow());
}
....
(some code here...)
Here's the problem:The Login Window display correctly inside the page with the Login button inside it.
Pressing the button the Event Mask display but after 1 second a runtime error appears inside an ext error window saying:
Server Error in '/' Application.
System.Web.HttpException: The control with ID 'ButtonLogin' not found
Does somebody know the possible cause of this error?
Help Please
Thanks....
Andrea Cammarata WebSite