日期:2014-05-17  浏览次数:20982 次

gridview里templatefield的headertext如何作按钮?
<asp:GridView ID="GridView1" runat="server">
<asp:TemplateField ShowHeader="False" HeaderText="首页" >
                <EditItemTemplate>
                    <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="True" 
                        CommandName="Update" OnClientClick="javascript:return confirm('确定要更改吗?');" Text="更新"></asp:LinkButton>
                    &nbsp;<asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" 
                        CommandName="Cancel" Text="取消"></asp:LinkButton>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:LinkButton ID="LinkButton3" runat="server" CausesValidation="false" 
                        CommandName="Insert" Text="新增"></asp:LinkButton>
                    <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" 
                        CommandName="Edit" Text="编辑"></asp:LinkButton>
                    <asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" 
                        CommandName="Delete" OnClientClick="javascript:return confirm('确定要删除吗?');" Text="删除"></asp:LinkButton>
                </ItemTemplate>
            </asp:TemplateField>