日期:2014-05-17 浏览次数:20461 次
<asp:GridView ID="allFMview" runat="server" AutoGenerateColumns="False" BackColor="#CCCCCC" BorderColor="#999999" BorderStyle="Solid" BorderWidth="3px" CellPadding="4" CellSpacing="2" ForeColor="Black" HorizontalAlign="Center" OnRowCommand="GridViewOnRowCom" DataKeyNames="name" onselectedindexchanged="allFMview_SelectedIndexChanged" onselectedindexchanging="allFMview_SelectedIndexChanging" onrowdeleting="allFMview_RowDeleting"> <Columns> <asp:TemplateField HeaderText = "机主名"> <ItemTemplate> <asp:Label ID="name" runat="server" Text='<%# Bind("name") %>'></asp:Label> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText = "电话"> <ItemTemplate> <asp:Label ID="phone" runat="server" Text='<%# Bind("phone") %>'></asp:Label> </ItemTemplate> </asp:TemplateField> <asp:CommandField HeaderText="选择" ShowSelectButton ="True" /> <asp:CommandField HeaderText="选择" ShowDeleteButton="True" /> </Columns> <HeaderStyle BackColor="#458B00" Font-Bold="True" ForeColor="White" /> </asp:GridView>
protected void allFMview_SelectedIndexChanged(object sender, EventArgs e) { Response.Write("<script>alert('22222222')</script>"); } protected void allFMview_SelectedIndexChanging(object sender, GridViewSelectEventArgs e) { Response.Write("<script>alert('33333333')</script>"); } protected void allFMview_RowDeleting(object sender, GridViewDeleteEventArgs e) { Response.Write("<script>alert('444444444')</script>"); }