[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now


Web App msgbox equivalent

Posted on 2004-10-25
Medium Priority
Last Modified: 2010-04-24

     On my screens, if the user chooses to delete a record, I want to flash them a quick verification question.  In a windows app this is done with MsgBox, but my web app doesn't like it.  What's the equivalent?  I just want to ask "Are you sure you want to delete this item?" and give them a yes/no option.

Question by:gleznov
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2

Accepted Solution

Glom earned 500 total points
ID: 12400524
I have been searching for such a thing a long time too. And the best solution I found is the following code. Put this in the Form.Load event to add a property to your target control that requires confirmation:

BtnDelete.Attributes.Add("onclick", "javascript:return confirm('Are you sure you want to delete this element ?');")

Hope this will help.


Author Comment

ID: 12400675
How do I handle a yes or a no?

LVL 22

Expert Comment

ID: 12400837
You do not handle a yes or no answer from the dialog box because it runs on the client. Adding an onClick attribute to your button will run on the client, and only when pressed yes.

With other words, the BtnDelete_Click event will only be fired after the user clicked 'yes' on the dialog.

Points to Glom.


Author Comment

ID: 12443179
Thanks to you both!

Featured Post

What’s Wrong with Your Cloud Strategy ?

Even as many CIOs are embracing a cloud-first strategy, the reality is that moving to the cloud is a lengthy process and the end-state is likely to be a blend of multiple clouds—public and private. Learn why multicloud solutions matter in this webinar by Nimble Storage.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses

650 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