I am trying to bring alert while i click the button if condition of "Gridview" label value is above zero. but its not working need your views.
<asp:TemplateField HeaderText="AGREEDVSISSUED" > <ItemTemplate> <asp:label ID="Literal4" runat="server" Text='<%# ok(Eval("agreed").ToString(), Eval("total_issued").ToString() )%>'> </asp:label>
protected void Button1_Click(object sender, EventArgs e) { var countForZero = from GridViewRow gr in gvEmployeeDetails.Rows where (gr.FindControl("Literal4") as Label).Text.Equals("0") select gr; if (countForZero.ToList().Count < 0) { Messagebox("Messagebox Pop up Alert!!!"); } BindGrid(); } private void Messagebox(string Message) { Label lblMessageBox = new Label(); lblMessageBox.Text = "<script language="'javascript'">" + Environment.NewLine + "window.alert('" + Message + "')</script>"; Page.Controls.Add(lblMessageBox); }