c# - Update Panel - The ScriptManager must appear before any controls that need it -
i tried put update panel in aspx form, keeps on showing error. scriptmanager must appear before controls need it
this aspx
<form id="form1" runat="server" class="form-horizontal"> <div class="col-lg-6"> <%--<asp:panel id="pnlexisting" runat="server"> <div class="alert alert-danger" role="danger"> <i class="glyphicon glyphicon-exclamation-sign"></i> <asp:label id="recordcheck" runat ="server"> </asp:label> </div> </asp:panel>--%> <div class="form-group"> <label class="control-label col-lg-4">project</label> <div class="col-lg-8"> <asp:dropdownlist id="ddlprojects" runat="server" class="form-control" autopostback="true" onselectedindexchanged="ddlprojects_selectedindexchanged" /><br /> </div> </div> <div class="form-group"> <label class="control-label col-lg-4">project code</label> <div class="col-lg-8"> <asp:textbox id="txtprojectcode" runat="server" class="form-control" required /> </div> </div> <%-- <div class="form-group"> <label class="control-label col-lg-4">price</label> <div class="col-lg-8"> <asp:textbox id="txtprice" runat="server" class="form-control" textmode="number" required /> </div> </div>--%> <%-- <div class="form-group"> <label class="control-label col-lg-4">status</label> <div class="col-lg-8"> <asp:textbox id="txtstatus" runat="server" class="form-control" required /> </div> </div>--%> </div> <asp:updatepanel id="upmaterialslist" runat="server"> <triggers> <asp:asyncpostbacktrigger controlid="lvmaterialslist" eventname="pagepropertieschanging" /> </triggers> <contenttemplate> <table class="table table-hover"> <thead> <th>material</th> <th>quantity</th> <th>status</th> <th>date added</th> <th>date modified</th> <th></th> </thead> <tbody> <asp:listview id="lvmaterialslist" runat="server" ondatabound="lvmaterialslist_databound" onpagepropertieschanging="lvmaterialslist_pagepropertieschanging" onitemcommand="lvmaterialslist_itemcommand"> <itemtemplate> <tr> <td><%# eval("supplierproduct")%></td> <td><%# eval("quantity") %></td> <td><%# eval("status") %></td> <td><%# eval("dateadded", "{0: mmmm dd, yyyy}") %></td> <td><%# eval("datemodified", "{0: mmmm dd, yyyy}") %></td> <td> <asp:label id="ltreqmat" runat="server" text='<%# eval("reqmatid") %>' visible="false" /> </td> <td> <asp:linkbutton text="approved" class="btn btn-success " id="lbtnapproved" runat="server" commandname="approve" > </asp:linkbutton> <asp:linkbutton text="decline" class="btn btn-warning " id="lbtndecline" runat="server" commandname="decline" > </asp:linkbutton> </td> </tr> </itemtemplate> <emptydatatemplate> <tr> <td colspan="12"><h2 class="text-center">no records found.</h2></td> </td> </tr> </emptydatatemplate> </asp:listview> </tbody> </table> <div class="col-lg-12"> <center> <asp:button id="btnreturn" runat="server" class="btn btn-default" text="back" postbackurl="default.aspx" formnovalidate /> </center> </div> <br /> <center> <asp:datapager id="dpmaterialslist" runat="server" pagesize="10" pagedcontrolid="lvmaterialslist"> <fields> <asp:numericpagerfield buttontype="button" numericbuttoncssclass="btn btn-default" currentpagelabelcssclass="btn btn-success" nextpreviousbuttoncssclass="btn btn-default" /> </fields> </asp:datapager> </center> </contenttemplate> </asp:updatepanel> </form>
i want know why not working properly
you have include scriptmanager
control in either content page or master page enable asp.net ajax features. in master page can place control after form
tag , ensure put before contentplaceholder
control:-
<form id="form1" runat="server"> <asp:scriptmanager id="scriptmanager1" runat="server"></asp:scriptmanager> <asp:contentplaceholder id="contentplaceholder1" runat="server"> </asp:contentplaceholder> </form>
by content page have master page set above master automatically use scriptmanager
.
apart this, if @ want include specific script reference in of content page can make use of scriptmanagerproxy
control @ run time combine properties of both scriptmanager
, scriptmanagerproxy
.
according asp.net ajax:-
scriptmanager - server control makes script resources available browser, including microsoft ajax library , functionality enables partial-page rendering.
scriptmanagerproxy - server control enables nested components add script , service references if page contains scriptmanager control.
Comments
Post a Comment