473,372 Members | 1,229 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,372 software developers and data experts.

Adding a confirmation pop-up window for datagrid delete

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.


Elton Wang

-----Original Message-----
(Type your message here)

From: Peter Rio

Iam trying add pop up window for delete but i am having problem with it..i am using data grid with push button for
the delete function plus am using java script on the
client side(HTMT) but dont really know how to make the pop
up work when the delete button is cliked..here is a html
code..Anyhelp would be really appreciated.thanks
<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR"> <meta content="Visual Basic .NET 7.1" name="CODE_LANGUAGE"> <meta content="JavaScript" name="vs_defaultClientScript"> <meta content="http://schemas.microsoft.com/intellisense/ie5"
name="vs_targetSchema"> <script language="javascript">
function confirm_delete()
if (confirm("Are you sure you want to delete this item?")==true) return true;
return false;

<body bgColor="#ffffff" MS_POSITIONING="GridLayout"> <form id="Form1" method="post" runat="server">
<asp:datagrid id="ViewBookingGrid" style="Z-INDEX: 101; LEFT: 16px; POSITION: absolute; TOP:
104px" BorderStyle="Solid" BorderColor="Gray" Runat="Server"
AutoGenerateColumns="False" CellPadding="1" OnDeleteCommand="dg_Delete" Height="216px" Font-
Size="X-Small" OnEditCommand="dg_Edit"
OnUpdateCommand="dg_Update" onCancelCommand="dg_Cancel" Font-Names="Arial"
Width="712px" DataKeyField="Booking_ID"> <AlternatingItemStyle Font- Names="Arial" BackColor="#CCCCCC"></AlternatingItemStyle> <ItemStyle ForeColor="Black"></ItemStyle> <HeaderStyle Font- Size="10pt" Font-Names="Arial" Font-Bold="True"
ForeColor="White" BackColor="#A2C1FF"></HeaderStyle> <Columns>
<asp:EditCommandColumn ButtonType="PushButton"
UpdateText="Update" CancelText="Cancel"
EditText="Edit"></asp:EditCommandColumn> <asp:BoundColumn DataField="Cust_Email" ReadOnly="True"
HeaderText="Customer Email"></asp:BoundColumn> <asp:BoundColumn DataField="Booking_Date" ReadOnly="True"
HeaderText="Booking Date"></asp:BoundColumn> <asp:BoundColumn DataField="Booking_Time" ReadOnly="True"
HeaderText="Booking Time"></asp:BoundColumn> <asp:BoundColumn DataField="Service_Type" ReadOnly="True"
HeaderText="Service Type"></asp:BoundColumn> <asp:BoundColumn DataField="Reported_fault" ReadOnly="True"
HeaderText="Reported Fault"></asp:BoundColumn> <asp:BoundColumn DataField="Model_Name" ReadOnly="True" HeaderText="Model
Name"></asp:BoundColumn> <asp:BoundColumn DataField="Model_No" ReadOnly="True" HeaderText="Model
No"></asp:BoundColumn> <asp:BoundColumn DataField="Sales_ID" ReadOnly="True" HeaderText="Receipt
No"></asp:BoundColumn> <asp:TemplateColumn> <HeaderTemplate> Status </HeaderTemplate> <ItemTemplate> <% #Container.DataItem("Status")%> </ItemTemplate> <EditItemTemplate> <asp:TextBox Id ="TxtStatus" Runat ="server" TexT
='<%#Container.DataItem("Status")%>'/> <asp:RequiredFieldValidator ID="rfvStatus"
Display="Dynamic" ErrorMessage="Status is required!"
Controltovalidate="TxtStatus" Runat="server" /> </EditItemTemplate> </asp:TemplateColumn> <asp:ButtonColumn Text="Delete" ButtonType="PushButton"
CommandName="Delete"></asp:ButtonColumn> </Columns>

Posted by a user from .NET 247 (http://www.dotnet247.com/)


Nov 19 '05 #1
0 2667

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

by: Martin Herrman | last post by:
Hi all, i'm quite new to javascript and can't find the answer on the net, but sorry if i'm going to ask a stupid question :-) I am programming in PHP. The PHP code makes a message which I want...
by: Marek Mänd | last post by:
<style type="text/css"> q:after{content:',"'} </style> <q>This will be the shame of CSS</q> claimed Marek Mänd and added that <q>consumers expect to create generated content via CSS where there...
by: Manfred Braun | last post by:
Hi All, I am trying to understand the blocking method socket.Send(). The call blocks as expected, but does this mean, it returnes after the underlying TCP layer got a confirmation, that the send...
by: Andy | last post by:
I have been struggling with this for a while, and have seen lots of related postings, but nothing (as far as I can see) that answers this directly. Im using vb dotnet and have an aspx that has a...
by: angus | last post by:
Dear all, I would like to implement something like that: when a user submit a request to get an item from the stock...... it will check the stock in the database if the level of that item is...
by: steggun | last post by:
How To: Popup Confirmation Dialog & Redirect in LinkButton_OnClick Hello All, I have a ASP.NET 2.0 (C#) web form with a LinkButton control. In the server-side code for the LinkButton_OnClick...
by: bienwell | last post by:
Hi all, I still have a problem when using Confirmation box in ASP.NET program. I need to get the value return of YES or NO from confirmation box in Sub function of VB program to do some tasks....
by: scout3014 | last post by:
Hi all I need help on one matter here. I have a php file which takes values from the form which calls the page and displays it for confirmation. I try to display using this: From: <input...
by: Paul McGuire | last post by:
1. With the current dict, the following code a = { "A" : 1, "B" : 2 } b = { "B" : 2, "A" : 1 } a==b evaluates to True. I assume that if these were odicts, this would evaluate to False. ...
by: Lewis Holmes | last post by:
Hi I have the following situation in one of my asp.net pages. The user can add multiple table rows to a form by selecting a button. These rows can contain asp.net controls. When this button is...
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.