Does anyone know how to troubleshoot the issue with this code? I am trying to make it so that when btnOne is clicked and a is true, a confirm box pops up. If yes is selected, then it should execute the btnTwo method. Currently, the popup isn't appearing and I'm unsure why. Any guidance on how to fix this or alternative methods would be greatly appreciated.
Any help or advice on this matter would be highly valued.
Here is an 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());
}