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
307 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

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

752 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