c# - MultiHandleSliderExtender: Error - Only one instance of a ScriptManager can be added to the page -



c# - MultiHandleSliderExtender: Error - Only one instance of a ScriptManager can be added to the page -

i want develop multi handler slider can adjusted both sides. script

<%@ page title="home page" language="c#" masterpagefile="~/site.master" autoeventwireup="true" codebehind="default.aspx.cs" inherits="webapplication4._default" %> <%@ register assembly="ajaxcontroltoolkit" namespace="ajaxcontroltoolkit" tagprefix="cc1" %> <asp:content id="bodycontent" contentplaceholderid="maincontent" runat="server"> <asp:scriptmanager runat="server" id="scriptmanager1" enablepartialrendering="true"/> <table> <tr> <td colspan="2"> <asp:updatepanel runat="server" id="updatepanel" updatemode="conditional"> <contenttemplate> <table> <tr> <td colspan="2"> <asp:textbox runat="server" id="txtslider"></asp:textbox> <cc1:multihandlesliderextender runat="server" id="multihandlesliderextender1" showhandledragstyle="false" behaviorid="multihandlesliderextender1" targetcontrolid="txtslider" length="200" showinnerrail="true" enablemousewheel="false" onclientdrag="drag" increment="1" raisechangeonlyonmouseup="true" enablerailclick="false" onclientdragend="dragend" showhandlehoverstyle="true" maximum="200" minimum="1"> <multihandleslidertargets> <cc1:multihandleslidertarget controlid="rangestart" /> <cc1:multihandleslidertarget controlid="rangeend" /> </multihandleslidertargets> </cc1:multihandlesliderextender> </br> </td> </tr> <tr> <td> <asp:label id="lblstartrange" runat="server" text=""></asp:label> </td> <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; <asp:label id="lblendrange" runat="server" text=""></asp:label> </td> </tr> <tr> <td> <asp:hiddenfield id="rangestart" runat="server" /> </td> <td> <asp:hiddenfield id="rangeend" runat="server" /> </td> </tr> <tr> <td colspan="2"> </td> </tr> </table> </contenttemplate> </asp:updatepanel> </td> </tr> </table> <script type="text/javascript"> var isdragging = false; function drag(sender, args) { getsliderrange($get("<%= rangestart.clientid %>").value, $get("<%= rangeend.clientid%>").value); } function dragend(sender, args) { <%-- //prevent postback on slider click if ($get("<%= hdftrackrangestart.clientid %>").value !== $get("<%= rangestart.clientid %>").value) { $get("<%= btnloadchart.clientid %>").click(); //__dopostback("<%= btnloadchart.clientid %>", ""); } if ($get("<%= hdftrackrangeend.clientid %>").value !== $get("<%= rangeend.clientid %>").value && $get("<%= hdftrackrangeend.clientid %>").value !== '0') { $get("<%= btnloadchart.clientid %>").click(); //__dopostback("<%= btnloadchart.clientid %>", ""); }--%> } function getsliderrange(startv, endv) { $get("<%= lblstartrange.clientid %>").innerhtml = getslidertext(arrrange[startv - 1], 's'); $get("<%= lblendrange.clientid %>").innerhtml = getslidertext(arrrange[endv - 1], 'e'); // alert(arrrange[startv - 1]); // pagemethods.sliderrange(startv, endv, this.callback); } function getslidertext(r, p) { var arrresult = r.split("--"); var strtext = ''; if (p === 's') { strtext = "<b>from</b> year: " + arrresult[0] + " month: " + arrresult[1]; } else { strtext = "<b>to</b> year: " + arrresult[0] + " month: " + arrresult[1]; } homecoming strtext; } </script> </asp:content>

initially m checking static values @ page_load as

protected void page_load(object sender, eventargs e) { if (!page.ispostback) { multihandlesliderextender1.minimum = 1; multihandlesliderextender1.maximum = 200; rangestart.value = multihandlesliderextender1.minimum.tostring(); rangeend.value = multihandlesliderextender1.maximum.tostring(); } }

thanks in advance. please help me out find bug.

that error in because working within page inherits master , have 2 scriptmanager declared.

for sure have , scriptmanager within site.masterand adding scriptmanager in page (default.aspx) too.

remove scriptmanager within childpage, because page going utilize site.master's one.

remove:

<asp:scriptmanager runat="server" id="scriptmanager1" enablepartialrendering="true"/>

c# asp.net asp.net-ajax

Comments

Popular posts from this blog

java Multi query from Mysql using netbeans -

c# - DotNetZip fails with "stream does not support seek operations" -

c++ - StartServiceCtrlDispatcher don't can access 1063 error -