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

Confirm Extender for ButtonField

I know how to add a confirmation or an AJAX extender to a regular button,
but is there any way to add a confirm (yes/no) to a ButtonField in a
Gridview?
Feb 4 '08 #1
1 8165
Hi elmo,

Unfortunatelly you cannot use ButtonField with ConfirmButtonExtender without
extra coding, insead i'd recommend using templatefield:

<asp:GridView runat="server" ID="gv" AutoGenerateColumns="false">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:Button runat="server" ID="btnDelete" Text="Delete"
CommandName="Delete" />
<ajaxtoolkit:confirmbuttonextender id="cbe" runat="server"
targetcontrolid="btnDelete"
confirmtext="Are you sure you want to delete this record?" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
or even better, why not just using templatefield with a button (no
confirmbuttonextender needed):

<asp:GridView runat="server" ID="gv" AutoGenerateColumns="false">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:Button runat="server" ID="btnDelete"
Text="Delete"
CommandName="Delete" OnClientClick="return
confirm('really?');" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
--

Hope this helps
Milosz
"Elmo Watson" wrote:
I know how to add a confirmation or an AJAX extender to a regular button,
but is there any way to add a confirm (yes/no) to a ButtonField in a
Gridview?
Feb 5 '08 #2

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

Similar topics

1
by: lanem | last post by:
I have a gridview. One of the columns is a buttonfield. I use the datatextfield property of buttonfield to show my bound value as a hyperlink in each buttonfield cell. I then want to get that...
0
by: googleThis | last post by:
I have a GridView control on a ASP.NET 2.0 page. I load the GridView with a SqlDataReader that gets its data from a stored procedure. Here is how the grid is defined: <asp:GridView...
11
by: Brad | last post by:
To DB2 Personal Developer Edition GIS users: How do I acquire a spatial extender license key for the DB2 PDE? I expected to be able to use it right out of the box. Brad
1
by: Mike P | last post by:
How do you add a confirm delete pop-up for a button field? I've managed to do this for a link button, where you can refer to the button id, but there is no id to refer to for a button field. ...
0
by: Jeff | last post by:
hey asp.net 2.0 Below I'm trying to specify a ButtonField. The problem is that when I click on the ButtonField (CommandName = UserName) I don't get info the UserName in the...
1
by: =?Utf-8?B?SGFycnkgS2Vjaw==?= | last post by:
I am using ASP.Net 2.0 themes, and have a GridView with a ButtonField column. I can not find a way to create a style for ButtonField columns in the application's theme, specifically, I want to set...
3
by: GaryDean | last post by:
I have a button field in a gridview defined as follows: <asp:ButtonField ButtonType="Button" CommandName="AcceptOrder" Text="Accept Whole Order"> <ControlStyle Font-Size="X-Small" />...
1
by: JLC | last post by:
For some reason I am getting this error. Cannot convert type 'System.Web.UI.Control' to 'System.Web.UI.WebControls.ButtonField' Here is my code for my .aspx file <asp:ButtonField...
4
by: Arnab das | last post by:
Below is the javascript code i am using function confirmDelete() { var returnValue = window.confirm("Deleting the current page. Continue?"); return returnValue; // var...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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
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,...

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.