﻿{"id":633,"date":"2010-06-10T01:57:00","date_gmt":"2010-06-09T17:57:00","guid":{"rendered":"http:\/\/blog.jixin.ntxz.net\/?p=633"},"modified":"2010-07-30T15:39:11","modified_gmt":"2010-07-30T07:39:11","slug":"asp-net-gridview%e6%b7%bb%e5%8a%a0%e5%88%a0%e9%99%a4%e7%a1%ae%e8%ae%a4%e5%af%b9%e8%af%9d%e6%a1%86","status":"publish","type":"post","link":"http:\/\/www.ntxz.net\/?p=633","title":{"rendered":"asp.net gridview\u6dfb\u52a0\u5220\u9664\u786e\u8ba4\u5bf9\u8bdd\u6846"},"content":{"rendered":"<div class=cnt>\n<h2><font size=2>\u65b9\u6cd5\u4e00:<\/font><\/h2>\n<div class=\"entry-body nerr\">\n<p>VB\u4ee3\u7801<\/p>\n<p>Protected Sub GridView1_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridView1.RowDataBound<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If e.Row.RowType = DataControlRowType.DataRow Then<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; e.Row.Cells(12).Attributes.Add(&#8220;onclick&#8221;, &#8220;return confirm(&#8216;\u4f60\u786e\u8ba4\u8981\u5220\u9664\u5417?&#8217;)&#8221;)<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End If<br \/>&nbsp;&nbsp;&nbsp;&nbsp; End Sub<\/p>\n<p>c#\u4ee3\u7801<\/p>\n<p>protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)<\/p>\n<p>{<\/p>\n<p>if (e.Row.RowType == DataControlRowType.DataRow)<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; e.Row.Cells[5].Attributes.Add(&#8220;onclick&#8221;, &#8220;return confirm(&#8216;\u4f60\u786e\u8ba4\u8981\u7f16\u8f91\u5417?&#8217;)&#8221;);<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<\/p>\n<p>}<\/p>\n<p><strong>\u65b9\u6cd5\u4e8c<\/strong><\/p>\n<p style=\"FONT-SIZE: 10pt\">\u5728VS2005\u63d0\u4f9b\u7684GridView\u4e2d\u6211\u4eec\u53ef\u4ee5\u76f4\u63a5\u6dfb\u52a0\u4e00\u4e2aCommandField\u5220\u9664\u5217\uff1a&lt;asp:CommandField ShowDeleteButton=&#8221;True&#8221; \/&gt;\uff0c\u7136\u540e\u5728GridView\u7684OnRowDeleting\u4e8b\u4ef6\u4e2d\u5b8c\u6210\u5220\u9664\u3002\u4f46\u4e00\u822c\u60c5\u51b5\u4e0b\u6211\u4eec\u5728\u505a\u8fd9\u79cd\u5220\u9664\u64cd\u4f5c\u65f6\u90fd\u9700\u8981\u5148\u8ba9\u7528\u6237\u786e\u8ba4\u4e00\u4e0b\uff0c\u7136\u540e\u540e\u518d\u5220\u9664\u8bb0\u5f55\uff0c\u4ee5\u907f\u514d\u8bef\u64cd\u4f5c\u5f15\u8d77\u7684\u8bef\u5220\u9664\u3002<\/p>\n<p style=\"FONT-SIZE: 10pt\">\u90a3\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u4e0b\u9762\u65b9\u6cd5\u7ed9GridView\u5220\u9664\u524d\u52a0\u4e0a\u4e00\u4e2a\u786e\u8ba4\u5bf9\u8bdd\u6846\u3002<\/p>\n<p style=\"FONT-SIZE: 10pt\">\u9996\u5148\uff0c\u5728GridView\u7684\u5c5e\u6027\u5bf9\u6846\u8bdd\u6846\u4e2d\u70b9\u51fb\u201cColumns\u201d\u8fdb\u5165\u5b83\u7684&#8221;\u5b57\u6bb5&#8221;\u8bbe\u8ba1\u5668;\u6216\u8005\u5728\u8bbe\u8ba1\u7a97\u53e3\u76f4\u63a5\u70b9\u51fbGridView\u63a7\u4ef6\u53f3\u4e0a\u89d2\u7684\u90a3\u4e2a\u5c0f\u7bad\u5934,\u70b9\u51fb&#8221;\u7f16\u8f91\u5217&#8221;,\u8fdb\u5165&#8221;\u5b57\u6bb5&#8221;\u8bbe\u8ba1\u5668\u3002<\/p>\n<p>\u63a5\u7740\u5728&#8221;\u5b57\u6bb5&#8221;\u8bbe\u8ba1\u5668\u4e2d\u7684\u5de6\u4e0b\u65b9&#8221;\u9009\u5b9a\u7684\u5b57\u6bb5&#8221;\u6846\u4e2d,\u9009\u62e9\u4ee5\u524d\u5df2\u52a0\u4e0a\u7684\u90a3\u4e2aCommandField\u201c\u5220\u9664\u201d\u5217\uff0c\u8fd9\u65f6\u5728\u53f3\u8fb9\u5b83\u7684\u5c5e\u6027\u5217\u8868\u4e0b\u4f1a\u770b\u5230\u4e00\u4e2a&#8221;\u5c06\u6b64\u5b83\u6bb5\u8f6c\u6362\u4e3a TemplateFied&#8221;\u7684\u9879\uff0c\u70b9\u51fb\u5c06\u5b83\u8f6c\u6362\u4e3aTemplateFied\u5217\u3002<\/p>\n<p style=\"FONT-SIZE: 10pt\">\u7136\u540e\u9000\u51fa&#8221;\u5b57\u6bb5&#8221;\u8bbe\u8ba1\u5668\uff0c\u5207\u6362\u5230\u6e90\u7801\u89c6\u56fe\u4f60\u4f1a\u53d1\u73b0\u8be5\u5217\u5df2\u7531\u539f\u6765\u7684\uff1a<br \/>&lt;asp:CommandField ShowDeleteButton=&#8221;True&#8221; \/&gt;<br \/>\u53d8\u4e3a\u4e86\uff1a<br \/>&lt;asp:TemplateField ShowHeader=&#8221;False&#8221;&gt;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;ItemTemplate&gt;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;asp:LinkButton ID=&#8221;LinkButton1&#8243; runat=&#8221;server&#8221; CausesValidation=&#8221;False&#8221;<\/p>\n<p style=\"FONT-SIZE: 10pt\">CommandName=&#8221;Delete&#8221;&nbsp;&nbsp; Text=&#8221;\u5220\u9664&#8221;&gt;&lt;\/asp:LinkButton&gt;<br \/>&lt;\/ItemTemplate&gt;<\/p>\n<p style=\"FONT-SIZE: 10pt\">\u6700\u540e\u5728&lt;asp:LinkButton&gt;\u4e2d\u52a0\u5165\uff1aOnClientClick=&#8221;return confirm(&#8216;\u60a8\u786e\u8ba4\u5220\u9664\u8be5\u8bb0\u5f55\u5417?&#8217;);&#8221;<\/p>\n<p style=\"FONT-SIZE: 10pt\">\u8fd9\u6837\u70b9\u51fb\u5220\u9664\u65f6\u5c31\u4f1a\u5148\u5728\u5ba2\u6237\u7aef\u5f39\u51fa\u201c\u60a8\u786e\u8ba4\u5220\u9664\u8be5\u8bb0\u5f55\u5417\uff1f\u201d\u5bf9\u8bdd\u6846,\u70b9\u51fb&#8221;\u786e\u5b9a&#8221;,\u5219\u8fdb\u884c\u5220\u9664;\u70b9\u51fb&#8221;\u53d6\u6d88&#8221;,\u5219\u4e0d\u5220\u9664.<br \/>\u800c\u539f\u6765\u5728onRowDeleting\u4e8b\u4ef6\u4e2d\u5199\u7684\u4ee3\u7801\u5b8c\u5168\u4e0d\u7528\u6539\u53d8\u3002<\/p>\n<h2><font size=2>\u65b9\u6cd5\u4e00:<\/font><\/h2>\n<div class=\"entry-body nerr\">\n<p>VB\u4ee3\u7801<\/p>\n<p>Protected Sub GridView1_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridView1.RowDataBound<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If e.Row.RowType = DataControlRowType.DataRow Then<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; e.Row.Cells(12).Attributes.Add(&#8220;onclick&#8221;, &#8220;return confirm(&#8216;\u4f60\u786e\u8ba4\u8981\u5220\u9664\u5417?&#8217;)&#8221;)<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End If<br \/>&nbsp;&nbsp;&nbsp;&nbsp; End Sub<\/p>\n<p>c#\u4ee3\u7801<\/p>\n<p>protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)<\/p>\n<p>{<\/p>\n<p>if (e.Row.RowType == DataControlRowType.DataRow)<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; e.Row.Cells[5].Attributes.Add(&#8220;onclick&#8221;, &#8220;return confirm(&#8216;\u4f60\u786e\u8ba4\u8981\u7f16\u8f91\u5417?&#8217;)&#8221;);<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<\/p>\n<p>}<\/p>\n<p><strong>\u65b9\u6cd5\u4e8c<\/strong><\/p>\n<p style=\"FONT-SIZE: 10pt\">\u5728VS2005\u63d0\u4f9b\u7684GridView\u4e2d\u6211\u4eec\u53ef\u4ee5\u76f4\u63a5\u6dfb\u52a0\u4e00\u4e2aCommandField\u5220\u9664\u5217\uff1a&lt;asp:CommandField ShowDeleteButton=&#8221;True&#8221; \/&gt;\uff0c\u7136\u540e\u5728GridView\u7684OnRowDeleting\u4e8b\u4ef6\u4e2d\u5b8c\u6210\u5220\u9664\u3002\u4f46\u4e00\u822c\u60c5\u51b5\u4e0b\u6211\u4eec\u5728\u505a\u8fd9\u79cd\u5220\u9664\u64cd\u4f5c\u65f6\u90fd\u9700\u8981\u5148\u8ba9\u7528\u6237\u786e\u8ba4\u4e00\u4e0b\uff0c\u7136\u540e\u540e\u518d\u5220\u9664\u8bb0\u5f55\uff0c\u4ee5\u907f\u514d\u8bef\u64cd\u4f5c\u5f15\u8d77\u7684\u8bef\u5220\u9664\u3002<\/p>\n<p style=\"FONT-SIZE: 10pt\">\u90a3\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u4e0b\u9762\u65b9\u6cd5\u7ed9GridView\u5220\u9664\u524d\u52a0\u4e0a\u4e00\u4e2a\u786e\u8ba4\u5bf9\u8bdd\u6846\u3002<\/p>\n<p style=\"FONT-SIZE: 10pt\">\u9996\u5148\uff0c\u5728GridView\u7684\u5c5e\u6027\u5bf9\u6846\u8bdd\u6846\u4e2d\u70b9\u51fb\u201cColumns\u201d\u8fdb\u5165\u5b83\u7684&#8221;\u5b57\u6bb5&#8221;\u8bbe\u8ba1\u5668;\u6216\u8005\u5728\u8bbe\u8ba1\u7a97\u53e3\u76f4\u63a5\u70b9\u51fbGridView\u63a7\u4ef6\u53f3\u4e0a\u89d2\u7684\u90a3\u4e2a\u5c0f\u7bad\u5934,\u70b9\u51fb&#8221;\u7f16\u8f91\u5217&#8221;,\u8fdb\u5165&#8221;\u5b57\u6bb5&#8221;\u8bbe\u8ba1\u5668\u3002<\/p>\n<p>\u63a5\u7740\u5728&#8221;\u5b57\u6bb5&#8221;\u8bbe\u8ba1\u5668\u4e2d\u7684\u5de6\u4e0b\u65b9&#8221;\u9009\u5b9a\u7684\u5b57\u6bb5&#8221;\u6846\u4e2d,\u9009\u62e9\u4ee5\u524d\u5df2\u52a0\u4e0a\u7684\u90a3\u4e2aCommandField\u201c\u5220\u9664\u201d\u5217\uff0c\u8fd9\u65f6\u5728\u53f3\u8fb9\u5b83\u7684\u5c5e\u6027\u5217\u8868\u4e0b\u4f1a\u770b\u5230\u4e00\u4e2a&#8221;\u5c06\u6b64\u5b83\u6bb5\u8f6c\u6362\u4e3a TemplateFied&#8221;\u7684\u9879\uff0c\u70b9\u51fb\u5c06\u5b83\u8f6c\u6362\u4e3aTemplateFied\u5217\u3002<\/p>\n<p style=\"FONT-SIZE: 10pt\">\u7136\u540e\u9000\u51fa&#8221;\u5b57\u6bb5&#8221;\u8bbe\u8ba1\u5668\uff0c\u5207\u6362\u5230\u6e90\u7801\u89c6\u56fe\u4f60\u4f1a\u53d1\u73b0\u8be5\u5217\u5df2\u7531\u539f\u6765\u7684\uff1a<br \/>&lt;asp:CommandField ShowDeleteButton=&#8221;True&#8221; \/&gt;<br \/>\u53d8\u4e3a\u4e86\uff1a<br \/>&lt;asp:TemplateField ShowHeader=&#8221;False&#8221;&gt;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;ItemTemplate&gt;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;asp:LinkButton ID=&#8221;LinkButton1&#8243; runat=&#8221;server&#8221; CausesValidation=&#8221;False&#8221;<\/p>\n<p style=\"FONT-SIZE: 10pt\">CommandName=&#8221;Delete&#8221;&nbsp;&nbsp; Text=&#8221;\u5220\u9664&#8221;&gt;&lt;\/asp:LinkButton&gt;<br \/>&lt;\/ItemTemplate&gt;<\/p>\n<p style=\"FONT-SIZE: 10pt\">\u6700\u540e\u5728&lt;asp:LinkButton&gt;\u4e2d\u52a0\u5165\uff1aOnClientClick=&#8221;return confirm(&#8216;\u60a8\u786e\u8ba4\u5220\u9664\u8be5\u8bb0\u5f55\u5417?&#8217;);&#8221;<\/p>\n<p style=\"FONT-SIZE: 10pt\">\u8fd9\u6837\u70b9\u51fb\u5220\u9664\u65f6\u5c31\u4f1a\u5148\u5728\u5ba2\u6237\u7aef\u5f39\u51fa\u201c\u60a8\u786e\u8ba4\u5220\u9664\u8be5\u8bb0\u5f55\u5417\uff1f\u201d\u5bf9\u8bdd\u6846,\u70b9\u51fb&#8221;\u786e\u5b9a&#8221;,\u5219\u8fdb\u884c\u5220\u9664;\u70b9\u51fb&#8221;\u53d6\u6d88&#8221;,\u5219\u4e0d\u5220\u9664.<br \/>\u800c\u539f\u6765\u5728onRowDeleting\u4e8b\u4ef6\u4e2d\u5199\u7684\u4ee3\u7801\u5b8c\u5168\u4e0d\u7528\u6539\u53d8\u3002<\/p>\n<h2><font size=2>\u65b9\u6cd5\u4e00:<\/font><\/h2>\n<div class=\"entry-body nerr\">\n<p>VB\u4ee3\u7801<\/p>\n<p>Protected Sub GridView1_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridView1.RowDataBound<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If e.Row.RowType = DataControlRowType.DataRow Then<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; e.Row.Cells(12).Attributes.Add(&#8220;onclick&#8221;, &#8220;return confirm(&#8216;\u4f60\u786e\u8ba4\u8981\u5220\u9664\u5417?&#8217;)&#8221;)<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End If<br \/>&nbsp;&nbsp;&nbsp;&nbsp; End Sub<\/p>\n<p>c#\u4ee3\u7801<\/p>\n<p>protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)<\/p>\n<p>{<\/p>\n<p>if (e.Row.RowType == DataControlRowType.DataRow)<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; e.Row.Cells[5].Attributes.Add(&#8220;onclick&#8221;, &#8220;return confirm(&#8216;\u4f60\u786e\u8ba4\u8981\u7f16\u8f91\u5417?&#8217;)&#8221;);<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<\/p>\n<p>}<\/p>\n<p><strong>\u65b9\u6cd5\u4e8c<\/strong><\/p>\n<p style=\"FONT-SIZE: 10pt\">\u5728VS2005\u63d0\u4f9b\u7684GridView\u4e2d\u6211\u4eec\u53ef\u4ee5\u76f4\u63a5\u6dfb\u52a0\u4e00\u4e2aCommandField\u5220\u9664\u5217\uff1a&lt;asp:CommandField ShowDeleteButton=&#8221;True&#8221; \/&gt;\uff0c\u7136\u540e\u5728GridView\u7684OnRowDeleting\u4e8b\u4ef6\u4e2d\u5b8c\u6210\u5220\u9664\u3002\u4f46\u4e00\u822c\u60c5\u51b5\u4e0b\u6211\u4eec\u5728\u505a\u8fd9\u79cd\u5220\u9664\u64cd\u4f5c\u65f6\u90fd\u9700\u8981\u5148\u8ba9\u7528\u6237\u786e\u8ba4\u4e00\u4e0b\uff0c\u7136\u540e\u540e\u518d\u5220\u9664\u8bb0\u5f55\uff0c\u4ee5\u907f\u514d\u8bef\u64cd\u4f5c\u5f15\u8d77\u7684\u8bef\u5220\u9664\u3002<\/p>\n<p style=\"FONT-SIZE: 10pt\">\u90a3\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u4e0b\u9762\u65b9\u6cd5\u7ed9GridView\u5220\u9664\u524d\u52a0\u4e0a\u4e00\u4e2a\u786e\u8ba4\u5bf9\u8bdd\u6846\u3002<\/p>\n<p style=\"FONT-SIZE: 10pt\">\u9996\u5148\uff0c\u5728GridView\u7684\u5c5e\u6027\u5bf9\u6846\u8bdd\u6846\u4e2d\u70b9\u51fb\u201cColumns\u201d\u8fdb\u5165\u5b83\u7684&#8221;\u5b57\u6bb5&#8221;\u8bbe\u8ba1\u5668;\u6216\u8005\u5728\u8bbe\u8ba1\u7a97\u53e3\u76f4\u63a5\u70b9\u51fbGridView\u63a7\u4ef6\u53f3\u4e0a\u89d2\u7684\u90a3\u4e2a\u5c0f\u7bad\u5934,\u70b9\u51fb&#8221;\u7f16\u8f91\u5217&#8221;,\u8fdb\u5165&#8221;\u5b57\u6bb5&#8221;\u8bbe\u8ba1\u5668\u3002<\/p>\n<p>\u63a5\u7740\u5728&#8221;\u5b57\u6bb5&#8221;\u8bbe\u8ba1\u5668\u4e2d\u7684\u5de6\u4e0b\u65b9&#8221;\u9009\u5b9a\u7684\u5b57\u6bb5&#8221;\u6846\u4e2d,\u9009\u62e9\u4ee5\u524d\u5df2\u52a0\u4e0a\u7684\u90a3\u4e2aCommandField\u201c\u5220\u9664\u201d\u5217\uff0c\u8fd9\u65f6\u5728\u53f3\u8fb9\u5b83\u7684\u5c5e\u6027\u5217\u8868\u4e0b\u4f1a\u770b\u5230\u4e00\u4e2a&#8221;\u5c06\u6b64\u5b83\u6bb5\u8f6c\u6362\u4e3a TemplateFied&#8221;\u7684\u9879\uff0c\u70b9\u51fb\u5c06\u5b83\u8f6c\u6362\u4e3aTemplateFied\u5217\u3002<\/p>\n<p style=\"FONT-SIZE: 10pt\">\u7136\u540e\u9000\u51fa&#8221;\u5b57\u6bb5&#8221;\u8bbe\u8ba1\u5668\uff0c\u5207\u6362\u5230\u6e90\u7801\u89c6\u56fe\u4f60\u4f1a\u53d1\u73b0\u8be5\u5217\u5df2\u7531\u539f\u6765\u7684\uff1a<br \/>&lt;asp:CommandField ShowDeleteButton=&#8221;True&#8221; \/&gt;<br \/>\u53d8\u4e3a\u4e86\uff1a<br \/>&lt;asp:TemplateField ShowHeader=&#8221;False&#8221;&gt;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;ItemTemplate&gt;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;asp:LinkButton ID=&#8221;LinkButton1&#8243; runat=&#8221;server&#8221; CausesValidation=&#8221;False&#8221;<\/p>\n<p style=\"FONT-SIZE: 10pt\">CommandName=&#8221;Delete&#8221;&nbsp;&nbsp; Text=&#8221;\u5220\u9664&#8221;&gt;&lt;\/asp:LinkButton&gt;<br \/>&lt;\/ItemTemplate&gt;<\/p>\n<p style=\"FONT-SIZE: 10pt\">\u6700\u540e\u5728&lt;asp:LinkButton&gt;\u4e2d\u52a0\u5165\uff1aOnClientClick=&#8221;return confirm(&#8216;\u60a8\u786e\u8ba4\u5220\u9664\u8be5\u8bb0\u5f55\u5417?&#8217;);&#8221;<\/p>\n<p style=\"FONT-SIZE: 10pt\">\u8fd9\u6837\u70b9\u51fb\u5220\u9664\u65f6\u5c31\u4f1a\u5148\u5728\u5ba2\u6237\u7aef\u5f39\u51fa\u201c\u60a8\u786e\u8ba4\u5220\u9664\u8be5\u8bb0\u5f55\u5417\uff1f\u201d\u5bf9\u8bdd\u6846,\u70b9\u51fb&#8221;\u786e\u5b9a&#8221;,\u5219\u8fdb\u884c\u5220\u9664;\u70b9\u51fb&#8221;\u53d6\u6d88&#8221;,\u5219\u4e0d\u5220\u9664.<br \/>\u800c\u539f\u6765\u5728onRowDeleting\u4e8b\u4ef6\u4e2d\u5199\u7684\u4ee3\u7801\u5b8c\u5168\u4e0d\u7528\u6539\u53d8\u3002<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u65b9\u6cd5\u4e00: VB\u4ee3\u7801 Protected Sub GridView1_RowDataBound(ByVal se [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1,8],"tags":[],"class_list":["post-633","post","type-post","status-publish","format-standard","hentry","category-1","category-oldblog"],"views":377,"_links":{"self":[{"href":"http:\/\/www.ntxz.net\/index.php?rest_route=\/wp\/v2\/posts\/633","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.ntxz.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.ntxz.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.ntxz.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.ntxz.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=633"}],"version-history":[{"count":1,"href":"http:\/\/www.ntxz.net\/index.php?rest_route=\/wp\/v2\/posts\/633\/revisions"}],"predecessor-version":[{"id":759,"href":"http:\/\/www.ntxz.net\/index.php?rest_route=\/wp\/v2\/posts\/633\/revisions\/759"}],"wp:attachment":[{"href":"http:\/\/www.ntxz.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=633"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.ntxz.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=633"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.ntxz.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=633"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}