Rohan Gupta

Rohan Gupta

  • 999
  • 751
  • 194.6k

Progress bar not working with update panel in side gridview

Jul 6 2015 6:48 AM
Progress bar not working with update panel in side gridview when we click on check box which is inside gridview..
 
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script type="text/javascript" src="http://www.unitedcooker.com/js/jquery.js"></script>
<script type="text/javascript">
function Show() {
document.getElementById('div_Loader').style.display = 'block';
}
function Hide() {
document.getElementById('div_Loader').style.display = 'none';
}
window.onload = Hide;
</script>
<%--<script type="text/javascript">
$(document).ready(function () {
$("#div_Loader").hide();
});
function Show() {
$('#div_Loader').show();
}
function Hide() {
$('#div_Loader').hide();
}
</script>--%>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager runat="server"></asp:ScriptManager>
<asp:UpdatePanel ID="u" runat="server">
<ContentTemplate>
<asp:GridView ID="grid1" runat="server">
<HeaderStyle BackColor="#df5015" Font-Bold="true" ForeColor="White" />
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:CheckBox ID="CheckBox1" runat="server" onchange="Show()" OnCheckedChanged="Unnamed1_CheckedChanged"
AutoPostBack="true" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
<div id="div_Loader">
<img src="loader.gif" />
</div>
<%--<div>
<asp:CheckBox runat="server" onchange="Show()" OnCheckedChanged="Unnamed1_CheckedChanged"
AutoPostBack="true" />
</div>--%>
</form> </body> </html>
 
 
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
BindGridview();
}
}
protected void Unnamed1_CheckedChanged(object sender, EventArgs e)
{
// Page.ClientScript.RegisterStartupScript(this.GetType(), "Hide", "Hide();", true);
}
protected void BindGridview()
{
SqlConnection con = new SqlConnection("Data Source=BRIJESH\\RRIJESH;Initial Catalog=Test;Integrated Security=True");
con.Open();
SqlCommand cmd = new SqlCommand("select * from tbl_emp", con);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);
grid1.DataSource = ds;
grid1.DataBind();
}
 
 
 

Answers (1)