c# - UpdateProgress not working on secound click -
updateprogress works on first button click . when click second time updateprogress didn't appeared.instead of updateprogress things works on second click. please me..
<asp:updatepanel id="updatepanel2" runat="server"> <triggers> <asp:asyncpostbacktrigger controlid="btnsubmit" /> </triggers> <contenttemplate> <div class="form-group row"> <div class="col-sm-6"> <p style="margin: 0 0 5px 0;"><b>class</b></p> <asp:dropdownlist id="drpclass" cssclass="form-control" onselectedindexchanged="drpclass_selectedindexchanged" autopostback="true" runat="server"></asp:dropdownlist> </div> <div class="col-sm-6"> <p style="margin: 0 0 5px 0;"><b>division</b></p> <asp:dropdownlist id="drpdiv" cssclass="form-control" runat="server"> </asp:dropdownlist> </div> </div> <div class="form-group row"> <div class="col-sm-6"> <p style="margin: 0 0 5px 0;"><b>date</b></p> <asp:textbox runat="server" id="txtdategiven" cssclass="form-control" placeholder="select date"></asp:textbox> <asp:calendarextender id="calendarextender2" runat="server" format="dd/mmm/yyyy" popupbuttonid="txtdategiven" targetcontrolid="txtdategiven"> </asp:calendarextender> </div> <div class="col-sm-6"> <p style="margin: 0 0 5px 0;"><b>date of submission</b></p> <asp:textbox runat="server" id="txtdatesubmit" cssclass="form-control" placeholder="select date"></asp:textbox> <asp:calendarextender id="calendarextender1" runat="server" format="dd/mmm/yyyy" popupbuttonid="txtdatesubmit" targetcontrolid="txtdatesubmit"> </asp:calendarextender> </div> </div> <div class="form-group row"> <div class="col-sm-12"> <p style="margin: 0 0 5px 0;"><b>subject</b></p> <asp:dropdownlist id="drpsubject" cssclass="form-control" runat="server"></asp:dropdownlist> </div> </div> <div class="form-group row"> <div class="col-sm-12"> <p style="margin: 0 0 5px 0;"><b>type</b></p> <asp:dropdownlist id="drpassignmenttype" cssclass="form-control" runat="server"></asp:dropdownlist> </div> </div> <div class="form-group row"> <div class="col-sm-12"> <p style="margin: 0 0 5px 0;"><b>title</b></p> <asp:textbox id="txtassignmenttitle" cssclass="form-control" placeholder="enter title" runat="server"></asp:textbox> </div> </div> <div class="form-group row"> <div class="col-sm-12"> <p style="margin: 0 0 5px 0;"><b>description</b></p> <asp:textbox id="txtassignmentdes" cssclass="form-control" textmode="multiline" height="250" placeholder="enter description" runat="server"></asp:textbox> </div> </div> </contenttemplate> </asp:updatepanel> <asp:updateprogress id="updprogress" associatedupdatepanelid="updatepanel1" runat="server"> <progresstemplate> <div class="modal"> <div class="center"> <span style="padding-left: 10px"><b>please wait..</b></span> <img alt="" src="../images/preloader_3.gif" width="50" height="50" /> </div> </div> </progresstemplate> </asp:updateprogress> <div class="form-group row"> <div class="col-sm-6"> <p style="margin: 0 0 5px 0;"><b>upload file</b></p> <asp:fileupload id="imgphoto" runat="server" /> <br /> <asp:button id="btnupload" text="upload" runat="server" onclick="upload" style="display: none" /> <% if (viewstate["image"] != null) {%> <a target="_blank" href="<%=viewstate["imagename"]%>">view attachment</a> <%} else { %> <asp:label id="label1" runat="server" forecolor="red" text="no file uploaded"></asp:label> <%} %> </div> </div> <asp:updatepanel id="updatepanel1" runat="server"> <contenttemplate> <div class="form-group row"> <div class="col-sm-6"> <div class="col-sm-6"> <asp:button id="btnsubmit" onclick="btnsubmit_click" onclientclick="javascript:return btnsubmit();" cssclass="btn btn-primary" runat="server" text="submit" /> <a href="assignment.aspx?sid=<%=request.querystring["sid"] %>" class="btn btn-default">cancel</a> </div> </div> </div> </contenttemplate> </asp:updatepanel>
code behind
updprogress.visible = true; sendemail(convert.toint32(drpdiv.text)); updprogress.visible = false; txtassignmenttitle.text = ""; txtassignmentdes.text = ""; txtdategiven.text = ""; txtdatesubmit.text = ""; viewstate["image"] = null; viewstate["imagename"] = null; drpassignmenttype.items.clear(); drpclass.items.clear(); drpdiv.items.clear(); drpsubject.items.clear(); drpsubject.items.insert(0, new listitem("--select--", "0")); drpassignmenttype.items.insert(0, new listitem("--select--", "0")); loadclass(); loadclassandassignmenttype(); drpdiv.items.insert(0, new listitem("--select--", "0"));
i using update panel avoid page load .also updateprogress didn't appeared if try reload page using response.redirect . please me ..
Comments
Post a Comment