|
-
Apr 3rd, 2007, 01:23 AM
#1
Thread Starter
Lively Member
confirm web page info
Hi all
I have bulit web page consist of many field after the user filled the application and click insert button , I want some dialog appear to ask the user if he sure from all information
I think this procedure will be made by script
please if any one has solution tell my
thanks
-
Apr 3rd, 2007, 02:36 AM
#2
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"/>
Last edited by brin351; Apr 3rd, 2007 at 02:44 AM.
-
Apr 3rd, 2007, 04:34 AM
#3
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.
-
Apr 8th, 2007, 03:40 AM
#4
Thread Starter
Lively Member
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
-
Apr 8th, 2007, 04:11 AM
#5
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|