Event Handler doesn't fire when I use the property NavigateUrl in Command

Hi,

i'm developing an application using the .Net Framework 2.0 with mobile controls

I have the following code:

protected void Page_Load(object sender, EventArgs e)

{

if (Page.IsPostBack)

{

Command cmd = (Command)Session["command1"];

cmd.Click += new EventHandler(cmdTeste);

ActiveForm.Controls.Add(cmd);

}

else

{

Command Command1;

Command1 = new Command();

Command1.ID = "cmd_continuar";

Command1.CommandName = "cmd_continuar";

Command1.SoftkeyLabel = "continuar";

Command1.ImageUrl = @"images/btn_continuar.gif";

Command1.Text = "dddddddd";

Command1.Click += new EventHandler(cmdTeste);

ActiveForm.Controls.Add(Command1);

Session["command1"] = Command1;

}

}

override protected void OnInit(EventArgs e)

{

this.Load += new EventHandler(this.Page_Load);

base.OnInit(e);

}

private void cmdTeste(object sender, EventArgs e)

{

Label1.Text = "ggg";

}

the sample code above doesn't work correctelly becasuse the handler cmdTeste does'nt fire, but if I comment the line

Command1.ImageUrl = @"images/btn_continuar.gif";

the code work correctelly.

Any help will be usefull.

thanks in advance



Answer this question

Event Handler doesn't fire when I use the property NavigateUrl in Command

  • edin

    These forums are for device development using NetCF and C++. http://forums.asp.net would be a better place for this question

  • Event Handler doesn't fire when I use the property NavigateUrl in Command