All articles| All Pictures| All Softwares| All Video| Go home page| Write articles| Upload pictures

Reading number is top 10 articles
教程:使用WebService进行异步通信_.net资料_编程技术
SQL 外链接操作小结 inner join left join right join_[SQL Server教程]
ASP.NET,2.0,AJAX中Webservice调用方法示例_.net资料_编程技术
C#中创建窗体
七种缓存使用武器,为网站应用和访问加速_php资料_编程技术
重新安装系统后,Sql,Server,2005,升级注意_[SQL,Server教程]
delphi组件的属性使用实例
SQL,Server,全局变量_[SQL,Server教程]
SQL初学者来看:认识SQL及SQL简介_[SQL Server教程]
ASP.NET数据库编程之Access连接失败_[Asp.Net教程]
Reading number is top 10 pictures
More attractive than sora aoi3
初五接财神啦!五路财神齐来到
Go to the national museum1
2012 national geographic daily picture8
Look for from human art net, is good--2
Desktop Wallpapers1
Hunan province aizhai super-large suspension bridge open to traffic and 4 world first1
鸡蛋的新玩法
美丽的桂林风光1
这才是真正的人体艺术2
Download software ranking
Visual C++界面编程技术
Tram sex maniac 2 (H) rar bag6
Boxer's Top ten classic battle5
软件工程思想
Boxer's Top ten classic battle3
致我们终将逝去的青春
ASP.NET.2.0.XML.高级编程(第3版)
The Bermuda triangle3
变速齿轮3.26
功夫熊猫2(上集)
delv published in(发表于) 2014/1/23 3:14:19 Edit(编辑)
在ASP.NET中为GridView添加删除提示框_[Asp.Net教程]

在ASP.NET中为GridView添加删除提示框_[Asp.Net教程]

在ASP.NET中为GridView添加删除提示框_[Asp.Net教程]

  在GridView中我们可以直接添加一个CommandField删除列来删除某行信息。但为了避免误操作引起的误删除,在删除操作者让操作者再确认下,完后再进行删除。


  首先我们给我们的GridView 添加一个模板列,如下:


<ASP:TemplateField HeaderText="Delete" ShowHeader="False">
<ItemStyle ForeColor="Red" />
<ItemTemplate>
 <asp:LinkButton ID="BtnDelete" runat="server" CausesValidation="False" CommandName="Delete"
Text="Delete"></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>


  其次我们给我们所添加的模板列添加:OnClientClick="return confirm('确认要删除此行信息吗?')" ,如下:


<asp:TemplateField HeaderText="Delete" ShowHeader="False">
<ItemStyle ForeColor="Red" />
<ItemTemplate>
 <asp:LinkButton ID="BtnDelete" runat="server" CausesValidation="False" CommandName="Delete"
Text="Delete" OnClientClick="return confirm('确认要删除此行信息吗?')"></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>


  点击删除时就会先在客户端弹出“确认要删除吗?”对话框,一般我们确认删除。







添加到del.icio.us 添加到新浪ViVi 添加到百度搜藏 添加到POCO网摘 添加到天天网摘365Key 添加到和讯网摘 添加到天极网摘 添加到黑米书签 添加到QQ书签 添加到雅虎收藏 添加到奇客发现 diigo it 添加到饭否 添加到飞豆订阅 添加到抓虾收藏 添加到鲜果订阅 digg it 貼到funP 添加到有道阅读 Live Favorites 添加到Newsvine 打印本页 用Email发送本页 在Facebook上分享


Disclaimer Privacy Policy About us Site Map

If you have any requirements, please contact webmaster。(如果有什么要求,请联系站长)
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.