<asp:GridView ID="GridView1" runat="server"> <Columns> <asp:TemplateField> <ItemTemplate> <asp:CheckBox ID="chkBox" runat="server" oncheckedchanged="CheckBox1_CheckedChanged" AutoPostBack="true" onclick="javascript:return Ischecked(this)" /> </ItemTemplate> </asp:TemplateField> <asp:TemplateField> <ItemTemplate> <%--<asp:Button ID="Button1" runat="server" Text="Button" CommandName="Hai" CommandArgument='<%# ((GridViewRow) Container).RowIndex %>'/>--%> </ItemTemplate> </asp:TemplateField> </Columns> </asp:GridView>
function Ischecked(ID) { var message1; if (ID.checked == true) { message1 = "ARE U Sure"; } return confirm(message1) ; }
function Ischecked(ID) { var message1; if (ID.checked == true) { message1 = "ARE U Sure"; } if(confirm(message1)) { __doPostBack(); } }
<b>in grid view for check box change this line</b> <asp:CheckBox ID="chkBox" runat="server" oncheckedchanged="CheckBox1_CheckedChanged" AutoPostBack="true" onclientclick="javascript:return Ischecked(this)" /> </ItemTemplate>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)