I have been trying to create a button in the code behind using the code below and also incorporating a confirmation message box for that button. However, it does not seem to be working. Can someone please assist me in fixing this issue?
Button btn = new Button();
btn.Attributes.Add(
"OnClientClick",
"if (confirm('Are you sure you want to proceed?')) return;");
if(condition)
{
//Do something
}