c# - Page still refreshes after wrapping the repeater in an update panel -


i've 2 sqldatasources , 2 repeaters, each repeater contains 1 hyperlink (i tried using web server button , anchors).

the hyperlinks fetch database values , in navigationurl property use string.format method create parameterized url, pass browser, second repeater populated according value passed in url passed first repeater's hyperlink

this sample code : https://gist.github.com/726213

<asp:scriptmanager id="scrptmanagr"  runat="server"></asp:scriptmanager> <asp:updatepanel id="updtpanl" runat="server">     <contenttemplate>         <asp:sqldatasource id="sqldatasource1" runat="server" connectionstring="<%$ connectionstrings:testconnectionstring %>"              selectcommand="select [arrange_by_id], [arrange_by] [arrange_by]">         </asp:sqldatasource>         <asp:repeater id="repeater1" runat="server" datasourceid="sqldatasource1">             <itemtemplate>                 <asp:hyperlink id="hyperlink3" navigateurl='<%# string.format("{0}?sortingtype={1}",request.apprelativecurrentexecutionfilepath, eval("arrange_by_id"))%>' runat="server"><%# eval("arrange_by") %></asp:hyperlink>             </itemtemplate>             <separatortemplate>                 |             </separatortemplate>         </asp:repeater>         <asp:sqldatasource id="sqldatasource2" runat="server" connectionstring="<%$ connectionstrings:testconnectionstring %>"              selectcommand="select [alphabet_id],[arrange_by_id], [value] [alphabet] ([arrange_by_id] = @arrange_by_id)">             <selectparameters>                 <asp:querystringparameter name="arrange_by_id" querystringfield="sortingtype" type="int32" defaultvalue="1" />             </selectparameters>         </asp:sqldatasource>         <br /><br />         <asp:repeater id="repeater2" runat="server" datasourceid="sqldatasource2">             <itemtemplate>                 <asp:hyperlink  id="hyper1" runat="server" navigateurl='<%#string.format("{0}?sortingtype={1}&sortby={2}",request.apprelativecurrentexecutionfilepath, eval("arrange_by_id"),eval("value"))%>'><%# eval("value")%></asp:hyperlink>             </itemtemplate>             <separatortemplate>                 |             </separatortemplate>         </asp:repeater>     </contenttemplate> </asp:updatepanel> 

now! everytime click of hyperlinks causes full post , refreshes page! missing ?

pretty sure <asp:hyperlink> isn't going partial update, renders html <a href=".."> tag. you'll need control causes postback, <asp:button> or <asp:linkbutton>.


Comments

Popular posts from this blog

Add email recipient to all new Trac tickets -

400 Bad Request on Apache/PHP AddHandler wrapper -

php - Change action and image src url's with jQuery -