473,769 Members | 7,355 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Delete Confirmation??

vivek kushwaha
7 New Member
Hi,
i have codes like this.

code behind page

Expand|Select|Wrap|Line Numbers
  1. Private Sub DataGrid1_ItemCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles DataGrid1.ItemCommand
  2. If e.CommandName = "changestatus" Then
  3.             clsMaster.ExecuteQry("update CaseMaster set Cancel = 'N', CanceledBy = '', CancelReason='', Reason1='', Notes='' where caseid=" & e.Item.Cells(1).Text & "")
  4.                 clsMaster.GridDatashow(DataGrid1, Session("Strqry"))
  5.         End If
  6. End Sub
aspx page code on datagrid1

Expand|Select|Wrap|Line Numbers
  1. <asp:TemplateColumn HeaderText="Reopen">
  2.                                                 <ItemStyle HorizontalAlign="left" Width="80px"></ItemStyle>
  3.                                                 <ItemTemplate>
  4.                                                     <asp:button CausesValidation="False" id="cButton" CommandName="changestatus"  runat="server"
  5.                                                         Text="Reopen Case" CssClass="button"></asp:button>
  6.                                                 </ItemTemplate>
  7.                                             </asp:TemplateColumn>
Finally i have to delete record to press above button. But i want a confirmation dialog box before deletion.
Feb 12 '08 #1
1 1165
kenobewan
4,871 Recognized Expert Specialist
You should be able to run a JS command via attribute add immediately before executing the update. HTH.
Feb 12 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
3096
by: Les Juby | last post by:
I've used a simple javascript for some time (no entries required up in the <head> tag) that asks for a confirmation before deleting. ie. <a href="/delete.asp?which=345 %>" onclick="javascript:return confirm('Are you ABSOLUTELY SURE you want to DELETE this record ?')">Delete record</a> On several sites I use short form constructs to generate a more recognizable button, and would like to use a simple script such as
4
9409
by: Stephen | last post by:
Hello People, Using MS Access 2003 VBA I get the error 3020 Update or CancelUpdate without AddNew or Edit when I run through the following code. Can anyone help suggest anything to try? Thanks. On Error GoTo delete_failed Dim RS_DEL As DAO.Recordset
6
1670
by: Dotnet Guy | last post by:
I want to add a confirmation dialog box before I delete the records in my form. I have a piece of javascript code in html that checks for confirmation. But the main issue lies in calling this javascript function on pagebehind. function confirm_delete() { if (confirm("Are you sure you want
3
2794
by: vcornjamb | last post by:
Hello, I am developing a web form that contains some buttons and a data grid which has as its last column link buttons that will delete the data associated with that row. Everything works fine, but users have requested a confirmation message pop up so the user can confirm the delete. I can not quite get this to work. Here are the facts: I am working in the Microsoft Development Environment 2003 (Version
4
3032
by: DrData | last post by:
I'm working on an ASP.Net application written in C#. On one page, there are several datagrid controls used to display, edit and delete detail records relating to the master record also displayed on that page. Each row in each datagrid includes a Delete button (added at runtime by the code-behind page as a ButtonColumn) and an Edit button (added at runtime by the code-behind page as an EditCommandColumn). What is the quickest, easiest and...
0
2688
by: Elton W | last post by:
Hi Peter, You use DeleteButton.Attributes.Add("onclick", "return confirm ('Are you sure you want to delete?');"); in datagrid_ItemDataBound event to add confirmation for delete button.
0
2271
by: Suzanne | last post by:
I'd like to know how can I put up a confirmation question when the user tries to delete a row in the datagrid by clicking on the row header and pressing the Delete key? I have found this code on a windows forms FAQ site : Public Class DataGrid_Custom Inherits DataGrid Private Const WM_KEYDOWN = &H100
17
2073
by: (PeteCresswell) | last post by:
I've got apps where you *really* wouldn't want to delete certain items by accident, but the users just have to have a "Delete" button. My current strategies: Plan A: ------------------------------------------------------------------------ 1) Make the cmd button black and do not give it an accelerator key. 2) Issue two levels of confirmation (Do you want to delete... Do you REALLY want
0
2011
by: johnmott | last post by:
Hi all, One of the limitations of the GridView control is that the built-in delete processing doesn't prompt for confirmation -- something thats very important for a user interface. True, you can add server side logic for this, but its much more reassuring to have a Javascript confirmation window open up and prompt. There are several techniques for doing this, just google 'Gridview delete confirm' to see them. I've figured out one which...
0
2822
by: Eraser | last post by:
Hi to all .NET guru guys... I have a problem in my delete button inside gridview. How to avoid postback on when i select cancel on confirmation message? But postback is okay on Ok confirmation. What happened is if I select cancel on my confirmation button, it executes the griedview postback which i assigned in my code behind. Please see my codes below... Code beind: protected void gvDefectCatalog_RowDataBound(object sender,...
0
9589
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9423
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10216
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10049
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9997
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
5448
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3965
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3565
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.