473,406 Members | 2,312 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,406 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.

HTH

Elton Wang
el********@hotmail.com

-----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
<HTML>
<HEAD>
<title>ViewBooking</title>
<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;
else
return false;
}

</script>
</HEAD>
<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/)

<Id>oih8bs4PM0SjpdW9zA9rww==</Id>
.

Nov 19 '05 #1
0 2669

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

Similar topics

2
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...
9
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...
13
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...
7
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...
0
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...
2
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...
2
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....
2
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...
1
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. ...
4
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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...
0
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,...
0
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...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.