Results 1 to 5 of 5

Thread: confirm web page info

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2006
    Posts
    97

    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

  2. #2
    Frenzied Member brin351's Avatar
    Join Date
    Mar 2007
    Location
    Land Down Under
    Posts
    1,293

    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.

  3. #3
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    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.

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Jul 2006
    Posts
    97

    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

  5. #5
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    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
  •  



Click Here to Expand Forum to Full Width