asp.net - Ajax Update Panel in Nested Listview not working -
i have ajax update panel inside nested listview shown below.
<%@ page title="lv ajax" language="vb" masterpagefile="~/masterpages/simplemasterpage.master" autoeventwireup="false" codefile="lv ajax.aspx.vb" inherits="lv_ajax" %>
listview ajax
<asp:scriptmanager id="scriptmanager1" runat="server"> </asp:scriptmanager> <asp:listview id="outerlistview" runat="server" datasourceid="sqldatasource1"> <emptydatatemplate> no data available. </emptydatatemplate> <itemtemplate> <asp:label id="photoalbumidlabel" runat="server" text='<%# eval("photoalbumid") %>' visible="false" /> <asp:updatepanel id="updatepanel1" runat="server"> <contenttemplate> <asp:listview id="innerlistview" runat="server" datasourceid="sqldatasource2"> <emptydatatemplate> <span>no data returned.</span> </emptydatatemplate> <itemtemplate> <br /> <asp:image id="image1" runat="server" imageurl='<%# eval("imageurl") %>' tooltip='<%# eval("tooltip") %>' width="400px" height="300px" /> <br /> </itemtemplate> <layouttemplate> <div id="itemplaceholdercontainer" runat="server" style=""> <span runat="server" id="itemplaceholder" /> </div> <asp:datapager id="datapager1" runat="server" pagesize="1"> <fields> <asp:nextpreviouspagerfield firstpagetext="<<" showfirstpagebutton="true" shownextpagebutton="false" previouspagetext="< " showpreviouspagebutton="true" /> <asp:numericpagerfield /> <asp:nextpreviouspagerfield lastpagetext=">>" showlastpagebutton="true" nextpagetext=" >" shownextpagebutton="true" showpreviouspagebutton="false" /> </fields> </asp:datapager> </span> </layouttemplate> </asp:listview> </contenttemplate> </asp:updatepanel> <asp:sqldatasource id="sqldatasource2" runat="server" connectionstring="<%$ connectionstrings:renaissanceconnectionstring1 %>" selectcommand="select [tooltip], [imageurl], [description], [photoalbumid], [sortorder] [picture] ([photoalbumid] = @paid) order [sortorder]"> <selectparameters> <asp:controlparameter controlid="photoalbumidlabel" defaultvalue="0" name="paid" propertyname="text" type="int32" /> </selectparameters> </asp:sqldatasource> <br /> </span> </itemtemplate> </asp:listview>
unfortunately when click datapager buttons although picture changes correctly, browser displays page top. if remove outer listview works keeping position on page.
this working correctly, if think code correct maybe suggest other changes.
if there genius out there can suggest solution appreciated.
many in anticipation.
your <asp:updatepanel>
tag missing <triggers>
element.
i think should like
<asp:updatepanel ... > <triggers> <asyncpostbacktrigger controlid='datapager1'> </triggers> <contenttemplate> .....
Comments
Post a Comment