使用SQLDATASOURCE在Gridview中编辑和删除记录后的必填确认消息 [英] Required Confirmation Message after the record edited and Deleted in Gridview using SQLDATASOURCE

查看:88
本文介绍了使用SQLDATASOURCE在Gridview中编辑和删除记录后的必填确认消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好朋友,

正在使用Asp.net,C#,SqlServer2005.

现在正在使用SqlDatasource在Asp.net Gridview中使用编辑删除功能".

编辑删除工作正常,但是我需要确认消息来编辑和删除记录.

为了进行编辑,我需要将消息显示为->您确定要删除该记录吗?
对于更新,我需要将消息显示为->记录已成功更新.

这是使用SQL DATASOURCE的My Gridview代码.........

Hello Friends,

Am working on Asp.net, C#, SqlServer 2005.

and now am working on Asp.net 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">
                    <Columns>
                        <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" />
                    </Columns>
                    <HeaderStyle BackColor="#FDCB0A" HorizontalAlign="Center" />
                </asp:GridView>
                <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)">
                </asp:SqlDataSource>





记录删除和记录编辑后,请帮我,我需要弹出消息".





Please help me, Just i Need a Pop up message after the record deleted and the record Edited.

Thanks in ADVANCE.

推荐答案

ConnectionStrings:AdminDBConnectionString %> " SelectCommand =" DeleteCommand =" UpdateCommand =" < /asp:SqlDataSource >
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)"> </asp:SqlDataSource>





记录删除和记录编辑后,请帮我,我需要弹出消息".

谢谢.





Please help me, Just i Need a Pop up message after the record deleted and the record Edited.

Thanks in ADVANCE.


请参阅:
http://www.aspdotnet-suresh.com/2011/01/how-to-delete-records-in-gridview-with.html [
See this:
http://www.aspdotnet-suresh.com/2011/01/how-to-delete-records-in-gridview-with.html[^]


这篇关于使用SQLDATASOURCE在Gridview中编辑和删除记录后的必填确认消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆