how to get confirmation before a export button is cliked.if yes then then export function has to be done if no it should not be done
+1
A:
I noticed that you are using asp.net. In webform applications, often we need a confirm dialog before doing postback.
//the page
<asp:button id="mybutton" runat="server" Text="Click to submit" />
//in code behind
mybutton.Click += (sender, args)=>
{
SubmitData();
};
//if you need to confirm before submit, you can add:
mybutton.OnClientClick = "if (!confirm('are you sure?')) return;";
//another way
mybutton.Attributes["onclick"] = "if (!confirm('are you sure?')) return;";
If you want to use your 'own confirm box' instead of confirm('are you sure?'):
window.showMedalDialog('myConfirmPage.aspx')
Danny Chen
2010-08-27 05:39:36