473,756 Members | 2,977 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Adding a confirmation pop-up window for datagrid delete

Hi Peter,

You use

DeleteButton.At tributes.Add("o nclick", "return confirm
('Are you sure you want to delete?');");

in datagrid_ItemDa taBound event to add confirmation for
delete button.

HTH

Elton Wang
el********@hotm ail.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.tha nks
<HTML>
<HEAD>
<title>ViewBook ing</title>
<meta content="Micros oft Visual Studio .NET 7.1" name="GENERATOR "> <meta content="Visual Basic .NET 7.1" name="CODE_LANG UAGE"> <meta content="JavaSc ript" name="vs_defaul tClientScript"> <meta content="http://schemas.microso ft.com/intellisense/ie5"
name="vs_target Schema"> <script language="javas cript">
function confirm_delete( )
{
if (confirm("Are you sure you want to delete this item?")==true) return true;
else
return false;
}

</script>
</HEAD>
<body bgColor="#fffff f" MS_POSITIONING= "GridLayout "> <form id="Form1" method="post" runat="server">
<asp:datagrid id="ViewBooking Grid" style="Z-INDEX: 101; LEFT: 16px; POSITION: absolute; TOP:
104px" BorderStyle="So lid" BorderColor="Gr ay" Runat="Server"
AutoGenerateCol umns="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="B ooking_ID"> <AlternatingIte mStyle Font- Names="Arial" BackColor="#CCC CCC"></AlternatingItem Style> <ItemStyle ForeColor="Blac k"></ItemStyle> <HeaderStyle Font- Size="10pt" Font-Names="Arial" Font-Bold="True"
ForeColor="Whit e" BackColor="#A2C 1FF"></HeaderStyle> <Columns>
<asp:EditComman dColumn ButtonType="Pus hButton"
UpdateText="Upd ate" CancelText="Can cel"
EditText="Edit" ></asp:EditCommand Column> <asp:BoundColum n DataField="Cust _Email" ReadOnly="True"
HeaderText="Cus tomer Email"></asp:BoundColumn > <asp:BoundColum n DataField="Book ing_Date" ReadOnly="True"
HeaderText="Boo king Date"></asp:BoundColumn > <asp:BoundColum n DataField="Book ing_Time" ReadOnly="True"
HeaderText="Boo king Time"></asp:BoundColumn > <asp:BoundColum n DataField="Serv ice_Type" ReadOnly="True"
HeaderText="Ser vice Type"></asp:BoundColumn > <asp:BoundColum n DataField="Repo rted_fault" ReadOnly="True"
HeaderText="Rep orted Fault"></asp:BoundColumn > <asp:BoundColum n DataField="Mode l_Name" ReadOnly="True" HeaderText="Mod el
Name"></asp:BoundColumn > <asp:BoundColum n DataField="Mode l_No" ReadOnly="True" HeaderText="Mod el
No"></asp:BoundColumn > <asp:BoundColum n DataField="Sale s_ID" ReadOnly="True" HeaderText="Rec eipt
No"></asp:BoundColumn > <asp:TemplateCo lumn> <HeaderTemplate > Status </HeaderTemplate> <ItemTemplate > <% #Container.Data Item("Status")% > </ItemTemplate> <EditItemTempla te> <asp:TextBox Id ="TxtStatus" Runat ="server" TexT
='<%#Container. DataItem("Statu s")%>'/> <asp:RequiredFi eldValidator ID="rfvStatus"
Display="Dynami c" ErrorMessage="S tatus is required!"
Controltovalida te="TxtStatus" Runat="server" /> </EditItemTemplat e> </asp:TemplateCol umn> <asp:ButtonColu mn Text="Delete" ButtonType="Pus hButton"
CommandName="De lete"></asp:ButtonColum n> </Columns>

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

<Id>oih8bs4PM0 SjpdW9zA9rww==</Id>
.

Nov 19 '05 #1
0 2687

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

Similar topics

2
7565
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 to show in a confirmation box using javascript. The message can be quite large (about 300 characters) and thus does not fit on one line. I noticed that although the HTML source file shows a complete text, the confirmation box does not; the end...
9
3756
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 would be no comma right after HERE</q>
13
8105
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 data was received by the socket on the remote end? Can I count on that? Do I understand TCP correctly in that, it gives confirmation ? I do not expect, that a .Net based receiver got that data when socket.Send() terminates!
7
4703
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 drop down list. For the selected item in the listbox a number of textboxes are populated from the database. The user can change the data in one or more of these text boxes, after which they should press the button that saves he data if they want...
0
881
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 smaller than a certain of amount if so......a confirmation (javascript:confirm('')) will be generated after
2
8989
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 event, I need to do some processing and, if it succeeds, popup a confirmation dialog and redirect to a different page. How can I do this? Here's some pseudo-code:
2
2027
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. For example, I have 2 text boxes and one button. The button will call On_Click event . Sub btnSelect_OnClick(ByVal sender As Object, ByVal e As EventArgs) Dim X as double = CDBL(txtbox1.text) Dim Y as double = CDBL(txtbox2.text)
2
1984
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 name="start" type="hidden" value="<?php echo $startDate; ?
1
154
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. 2. Will odict.byindex support slicing?
4
4490
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 selected, the row is added using JavaScript. The script uses cloneNode to clone a hidden template row and all of its children and then adds the new row to the table, updates all of the child control Ids and sets visibility etc. The hidden...
0
9456
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
9275
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
10040
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
9873
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...
0
9713
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7248
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
3806
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
3359
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2666
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.