Posting an OK/cancel dialogue box using ASP.NET/VB.NET 2005

Posted on 2006-05-15
Last Modified: 2008-01-09
I have used the following code:

im.Attributes.Add("onclick", "if(confirm('The selected record will now be removed.')){}else{return false}")
(where im is a hyperlink or imagebutton)

to make a dialogue box appear that has the options OK and cancel, where cancel does nothing and OK will go to the navigateurl method of the hyperlink.

The problem is this: I would like to make 2 customizations of this dialogue box:
  1) Display a custom title, rather than Microsoft Internet Explorer
  2) Have the buttons say YES and NO, YES and CANCEL, or YES, NO, AND CANCEL

Any suggestions would be most appreciated.
Question by:stev0931
    LVL 11

    Accepted Solution

    Here you can download a solution:

    Author Comment

    Is there anyway I can accomplish what I'm after with a slight modification of the code I already have? (Since that would keep this quite simple)
    LVL 11

    Assisted Solution

    Unfortunately the answer is 'No', I don't think you can customize confirm message box to accommodate your requirements.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
    Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now