Oct 30, 2009, 1:19 PM
Click Behavior Different from ASP Button and Coolite Button
Hello everyone,
I have been trying to add a click event to a Coolite button, and I have noticed that the behavior of the button is different from the behavior of an ASP button with the same click event.
ASP Button Implementation:
I tried setting ViewStateMode = ViewStateMode.Include, and it hasn't made a difference. Does anyone know what I am doing wrong? I would like to use Coolite buttons instead of ASP buttons.
Thanks!
I have been trying to add a click event to a Coolite button, and I have noticed that the behavior of the button is different from the behavior of an ASP button with the same click event.
ASP Button Implementation:
button1.Click += new EventHandler(btnClick_Click);
With this, the server side code executes normally. It updates the viewstate, and it then executes the ShowGeneralStep as expected. public void btnClick_Click(object sender, EventArgs e)
{
activeViewIndex = 0;
ViewState.Add("ACTIVEVIEWINDEX", activeViewIndex);
ShowGeneralStep();
}
If I use a Coolite button through, and I add the event using either AjaxEvents or Listeners, it does not execute the code as expected. It runs through the btnClick_Click method, but when the page reloads, the activeViewIndex and ViewState have not been changed. I also tried this with a Coolite button..
button1.Click += new EventHandler(btnClick_Click);
And it didn't do anything. It didn't even try to call btnClick_Click.I tried setting ViewStateMode = ViewStateMode.Include, and it hasn't made a difference. Does anyone know what I am doing wrong? I would like to use Coolite buttons instead of ASP buttons.
Thanks!