.NETGURU
Client Side Confirmation For Delete
Messages   Related Types
This message was discovered on ASPFriends.com 'aspngclient' list.


CBurnet2@fnmortgage.com
-- Moved from [aspngfreeforall] to [aspngclient] by Marcie Jones <Click here to reveal e-mail address> --

I am trying to create a form with two buttons: Save and Delete. When the
user clicks Save the normal server side event handler would work and the
item would get saved. However when the user clicks Delete I would like to
have a JavaScript confirm dialog come up and ask them if they really want to
delete. If they click Cancel in the JavaScript confirm dialog then nothing
would happen. If they click OK in the JavaScript confirm dialog then the
page would continue with the normal server side event handler for the Delete
button. Is this possible? I have read a few articles at different ASP.NET
sites that all deal with making it work inside the DataGrid. I am not using
the DataGrid, just a normal ASP.NET page. Also those articles refer to
using the Page.RegisterOnSubmitStatement method to add in an OnSubmit event
handler to the form tag. However, unless I am missing something, this will
not really help me because that event handler will fire ALL of the time that
the form is submitted regardless of whether I have clicked the Save button
or the Delete button.

I have included a simple ASP.NET page that illustrates what I am trying to
do:

<script runat="server">

Sub SaveButton_Click(sender As Object, e As EventArgs)
'Save code goes here...
End Sub

Sub DeleteButton_Click(sender As Object, e As EventArgs)
'Delete code goes here...
End Sub

</script>
<html>
<form runat="server">
<asp:TextBox id="myName" runat="server" />
<asp:Button id="SaveButton" onclick="SaveButton_Click" runat="server" />
<asp:Button id="DeleteButton" onclick="DeleteButton_Click"
runat="server" />
</form>
</html>

Corey Burnett
Development Team Lead
First Nationwide Mortgage
301-696-4703
Click here to reveal e-mail address

Reply to this message...
 
    
Andy Smith
use my ConfirmedButtons components.
http://www.aspalliance.com/asmith/articles/ConfirmedButtons.aspx

__
Andy Smith
Keyboard Jockey #3a7-2.78.1

[Original message clipped]

Reply to this message...
 
    
Tim Cools
With mybutton.attributes.add()
Add the onclick attribute to the button and the confirm() from
javascript
This will do the trick

Tim=20

-----Original Message-----
From: Andy Smith [mailto:Click here to reveal e-mail address]=20
Sent: donderdag 11 juli 2002 18:58
To: aspngclient
Subject: [aspngclient] RE: Client Side Confirmation For Delete

use my ConfirmedButtons components.
http://www.aspalliance.com/asmith/articles/ConfirmedButtons.aspx

__
Andy Smith
Keyboard Jockey #3a7-2.78.1

[Original message clipped]

| [aspngclient] member Click here to reveal e-mail address =3D YOUR ID
| http://www.aspfriends.com/aspfriends/aspngclient.asp =3D JOIN/QUIT

Reply to this message...
 
    
Andy Smith

__
Andy Smith
Keyboard Jockey #3a7-2.78.1

[Original message clipped]

Reply to this message...
 
 
System.EventArgs
System.Web.UI.MobileControls.TextBox
System.Web.UI.Page
System.Web.UI.WebControls.DataGrid
System.Web.UI.WebControls.TextBox
System.Windows.Forms.DataGrid
System.Windows.Forms.TextBox




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification