Is there a way to make the following code works? Basically, when I click on btnOne, If a is true, i expect it to popup the confirm box. And If i press yes, then it will execute btnTwo method. Otherwise, it will not do anything. At the moment, it doesn't do the popup and i am not sure why. Can someone please point me in the right direction? or possibly let me know other way of achieving this.
Any information would be much appreciated.
For example:
public void btnTwo(object sender, EventArgs e)
{
//Do some processing
}
public void btnOne(object sender, EventArgs e)
{
if( a == true )
btnTwo.Attributes["onClick"] = "return confirm('test');"
btnTwo(sender, new EventArgs());
}
a? And where are you invoking anything server-side?