Solved

ASP.Net - How do I return the value from this.btnDelete.Attributes.Add("onclick","if(confirm('Are you sure you want to delete this Equipment Request?')){}else{return false}");

Posted on 2003-12-01
2
290 Views
Last Modified: 2006-11-17
I have the following code
            this.btnDelete.Attributes.Add("onclick","if(confirm('Are you sure you want to delete this Equipment Request?')){}else{return false}");


When the btnDelete is clicked How do I 'trap'  if the true or false on a confirmation screen?
0
Comment
Question by:JElster
2 Comments
 
LVL 2

Accepted Solution

by:
yleviel earned 50 total points
Comment Utility
what do you mean by 'trap'?

Do you mean you want to stop the form from continuing to post?  If so, consider changing the code to:

this.btnDelete.Attributes.Add("onclick","return confirm('Are you sure you want to delete this Equipment Request?')");
0
 

Expert Comment

by:negreteo
Comment Utility
How do I know that the user clicked Yes or No?
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

771 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

9 Experts available now in Live!

Get 1:1 Help Now