onclick attribute does not fire help....

Joined
Jun 27, 2008
Messages
1
Reaction score
0
Hello,

I have two buttons. the first button test some condition and if its true it will add onclick attribute event on the second button. but when i call the event method of that button the onclick, which has a javascript "AlertPayment" code does not fire.. here's my code.. thank you


private void btSubmit_Click(object sender, System.EventArgs e)
{
if (bValid)
{ this.btHiddenSubmit.Attributes.Add("onclick", "return AlertPayment('" + sMessage + "');");
btHiddenSubmit_Click(sender, e); //calling the click method won't fire the onclick alertpayment javascript;
}
else
{
btHiddenSubmit_Click(sender, e);
}
}
------

private void btHiddenSubmit_Click_Click(object sender, System.EventArgs e)
{
.... my code here
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,140
Latest member
SweetcalmCBDreview
Top