Results 1 to 3 of 3

Thread: asp.net c# messagebox

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2006
    Posts
    719

    asp.net c# messagebox

    Code:
    Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "MsgBox", "window.confirm('Show'); ;", true);
    i put the code above to display a confirmation message box.. but the problem is whatever button i clicked, it still contitue.. all i want to happen is when i clicked the cancel button, it will not proceed..

    thanks

  2. #2
    Learning .Net danasegarane's Avatar
    Join Date
    Aug 2004
    Location
    VBForums
    Posts
    5,853

    Re: asp.net c# messagebox

    The thing is that the Page.ClientScript.RegisterClientScriptBlock method will add the script to your page and will not call the page. You need to tell on which click button to invoke the event as shown in MSDN
    Please mark you thread resolved using the Thread Tools as shown

  3. #3
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: asp.net c# messagebox

    Hello,

    You might also want to take a look at this approach:

    http://www.asp.net/data-access/tutor...en-deleting-vb

    Assuming that you are trying to get a client side confirmation when you click a button, you can simply add something like:

    Code:
    OnClientClick="return confirm('Are you certain you want to delete this product?');"
    To the button that you want the confirmation on.

    Gary

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