Click here to Skip to main content
Rate this: bad
Please Sign up or sign in to vote.
See more: ASP.NET Gridview
Hello Friends,
Am working on, C#, SqlServer 2005.
and now am working on Gridview with Edit delete Functions in it using SqlDatasource.
Edit Delete is working fine, But i need Confirmation Message for editing and deleting the records.
For Editing i need the message as -> Are you sure you want to delete this record ?
For Updating I need the message as -> Records Updated Successfully.
This is My Gridview Code using SQL DATASOURCE.........
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
                    DataSourceID="SqlDataSource1" HorizontalAlign="Center" Width="800px"
                    AllowPaging="True" AutoGenerateDeleteButton="True"
                    AutoGenerateEditButton="True" BackColor="#E0E0E0" CellPadding="5"
                    CellSpacing="1" DataKeyNames="Id">
                        <asp:BoundField DataField="Id" HeaderText="Id" InsertVisible="False"
                            ReadOnly="True" SortExpression="Id" Visible="false"/>
                        <asp:BoundField DataField="UserName" HeaderText="UserName"
                            SortExpression="UserName" />
                        <asp:BoundField DataField="Password" HeaderText="Password"
                            SortExpression="Password" />
                        <asp:BoundField DataField="FirstName" HeaderText="FirstName"
                            SortExpression="FirstName" />
                        <asp:BoundField DataField="LastName" HeaderText="LastName"
                            SortExpression="LastName" />
                        <asp:BoundField DataField="Email" HeaderText="Email" SortExpression="Email" />
                    <HeaderStyle BackColor="#FDCB0A" HorizontalAlign="Center" />
                <asp:SqlDataSource ID="SqlDataSource1" runat="server"
                    ConnectionString="<%$ ConnectionStrings:AdminDBConnectionString %>"
                    SelectCommand="SELECT [Id], [UserName], [Password], [FirstName], [LastName], [Email] FROM [FidsAdminLogin]"
                    DeleteCommand="DELETE FROM AdminLogin WHERE (Id = @Id)"
                    UpdateCommand="UPDATE AdminLogin SET UserName = @UserName, Password = @Password, FirstName = @FirstName, LastName = @Lastname, Email = @Email WHERE (Id = @Id)">

Please help me, Just i Need a Pop up message after the record deleted and the record Edited.
Thanks in ADVANCE.
Posted 26-Nov-12 19:03pm

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Software Engineer 892 at 27-Nov-12 1:11am
This is done by coding, I used Sql Datasource.
Please help, How to display Confirmation Message using SqlDATASOURCE.
Krunal R at 27-Nov-12 1:14am
That works behind the scene.. You should go with what I have suggested.. Try to understand all that code..

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 321
1 Sergey Alexandrovich Kryukov 286
2 RyanDev 75
3 PhilLenoir 70
4 nv3 60
0 Sergey Alexandrovich Kryukov 6,691
1 OriginalGriff 6,119
2 CPallini 2,473
3 Richard MacCutchan 1,697
4 Abhinav S 1,560

Advertise | Privacy | Mobile
Web01 | 2.8.140821.2 | Last Updated 27 Nov 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100