Re: confirm web page info
Try the script below - I haven't used it for a while but I think it's all there. Basically it triggers the javascript alert/dialog before the post back and offers to OK/Cancel .
Code:
<script type="text/javascript">
function yesNo(){
//NOTE the onmousedown event is used to triger this function
//because it happens before a click and will not fire a postback
input_box=confirm("Click OK or Cancel to Continue");
if (input_box==true)
{
// fire the postback
__doPostBack('btnYesNo','');
// or you could fire the click event this way
//document.getElementById("btnYesNo").click;
}
else
{
// Output when Cancel is clicked
alert ("You clicked cancel");
}
}
</script>
Then in your button call the script
<input id="btnYesNo" onmousedown="yesNo();" type="button" value="Yes No Dialog" runat="server"/>
Re: confirm web page info
That's complicating things. You shouldn't ideally have to perform a postback as such if this is the case. Instead, do this
onClick="return confirm('Are you sure?');"
in your form submit button.
Re: confirm web page info
I found good solution
in VB.NET 2005 you do not need script to make confirm dialog
you can insert reference from solution explorer to your project System.Windows.Forms
and inside your code page write Imports System.Windows.Forms
and use Messagebox.Show
Re: confirm web page info
That is an incorrect solution. It will not work for the client, because that MessageBox will show up only on the server, but not the client's machine.