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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
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…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…
This is a video describing the growing solar energy use in Utah. This is a topic that greatly interests me and so I decided to produce a video about it.

914 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

17 Experts available now in Live!

Get 1:1 Help Now