Отображение прогресса только при загрузке сеток
In my application i have two drop downs the problem is on changing the drop down selection i am loads multiple grids in a tree structure, but loading these grids takes little longer time it nearly takes 5 min to load all the grids to avoid this i am showing the loading progress and below is the code that i have used
aspx code <form> <img style="visibility:hidden;" src="~/Image/loader.gif" runat="server" id="loading_image" /> <asp:DropDownList ID="ddl1" runat="server" Height="22px" Width="121px" OnSelectedIndexChanged="ddlYear_SelectedIndexChanged" AutoPostBack="True"> </asp:DropDownList> <asp:DropDownList ID="ddl2" runat="server" Height="22px" Width="121px" OnSelectedIndexChanged="ddlYear_SelectedIndexChanged" AutoPostBack="True"> </asp:DropDownList> </form> .cs code protected void Page_Load(object sender, EventArgs e) { ddlYear.Attributes.Add("onchange", "document.getElementById(\"loading_image\").style.visibility = \"visible\";"); } protected void ddl1_SelectedIndexChanged(object sender, EventArgs e) { i = 0; imgid.Visible = true; imgid1.Visible = true; imgid2.Visible = true; imgid3.Visible = true; imgid4.Visible = true; imgid5.Visible = true; imgid6.Visible = true; lbl1.Visible = true; lbl2.Visible = true; lbl3.Visible = true; lbl4.Visible = true; lbl5.Visible = true; lbl6 = true; if (ddl1.SelectedItem.Text != "Select") { lbl2.Text = ddlYear.SelectedItem.Text; DataBind(Session["abc"].ToString(), ddl1.SelectedItem.Text, Session["name"].ToString()); Bind(Session["dept"].ToString(), ddl1.SelectedItem.Text, Session["name"].ToString()); } else { } } protected void ddl2_SelectedIndexChanged(object sender, EventArgs e) { i = 0; imgid.Visible = true; imgid1.Visible = true; imgid2.Visible = true; imgid3.Visible = true; imgid4.Visible = true; imgid5.Visible = true; imgid6.Visible = true; lbl1.Visible = true; lbl2.Visible = true; lbl3.Visible = true; lbl4.Visible = true; lbl5.Visible = true; lbl6 = true; if (ddl1.SelectedItem.Text != "Select") { lbl2.Text = ddlYear.SelectedItem.Text; DataBind(Session["abc"].ToString(), ddl1.SelectedItem.Text, Session["name"].ToString()); Bind(Session["dept"].ToString(), ddl1.SelectedItem.Text, Session["name"].ToString()); } else { } }
the problem with above code is the loading progress is always getting displayed even after the grids are loaded but i need to display the loading progress only for the time when grids are getting loaded and once if grids loaded this loading progress should not appear how can i do this
Что я уже пробовал:
я попробовал выше код, но он не работает
[no name]
Вы можете использовать элементы управления UpdatePanel и UpdateProgress для блокировки пользовательского интерфейса и отображения сообщения о загрузке. Если вам нужно что-то вроде индикатора прогресса с текущим статусом, то вам нужно его улучшить.