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
302 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
[X]
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 Comments
 
LVL 2

Accepted Solution

by:
yleviel earned 50 total points
ID: 9853536
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
ID: 13384751
How do I know that the user clicked Yes or No?
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
RegEx Help - open to other simple suggestions 8 63
Weighted Randomizing 6 33
Executing a script on a timer online 5 32
XML and version of MS XML Dom Document versions 5 33
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 informatio…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

749 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