以下のコードを使用して、コードビハインドでボタンを作成し、そのボタンの確認メッセージボックスも作成しています.しかし、これを作成するのを手伝ってください..
Button btn2 = new Button();
btn2.Attributes.Add(
    "OnClientClick", 
    "if (confirm(''Are you sure you want to add this estimate data?')) return;");
if(true) 
{
    //Do something
}