Showing posts with label repeater. Show all posts
Showing posts with label repeater. Show all posts

Wednesday, March 28, 2012

Multiple UpdatePanels require their controls to enable ViewState?

I've got 2 update panels on the same page. up1 contains a link button and up2 contains a repeater. I don't need or want the repeater in up2 to be added to Viewstate. However, when up1's link button is clicked, the async call works fine but on return it clears out up2's content. If I set the repeater in up2 to enable viewstate, it then works. If upatepanels are supposed to implement partial page updates, why does up1 wipe out up2's content if up2's content is not in viewstate?

A wild stab in the dark : Is up2.UpdateMode set to "Condtional" ?? if not, then it has a default mode "Always", and gets refreshed on each async postback. If you do not redraw the repeater at that time, or get it from viewstate, then well - you get zilch :)


Ah, yes, that's it. I would have thought the default updatemode would be "Conditional" rather than "Always". Having all the updatepanels update seems counterintuitive to the idea of a partial page update. Anyway, thanks.

Wednesday, March 21, 2012

Need help with hover menu on repeater rows..

Hi all! I am trying to use Hover Menu... on the rows generated by asp repeater.. and add EDIT and DELETE Link buttons in the menu... In on of the post in this forum I found that we need to initilize for every row.. I confused.. it wud be gr8 if any help me with some sample code...

<asp:Panel runat="server" ID="pnlcurroffer" GroupingText="<b>Current Offers Info</b>" Height="400px" Width="350" >
<asp:Button ID="btncurrprev" runat="server" CssClass="tbox" Text="<<" OnClick="currprev" />
<asp:Label ID="lblcurrpage" runat="server" />
<asp:Button ID="btncurrnxt" runat="server" CssClass="tbox" Text=">>" OnClick="currlnext" /
<table cellpadding="0" cellspacing="0" border="0" class="main" width="95%"
<tr>
<td colspan="4" class="top line"><img src="http://pics.10026.com/?src=~../images/spc.gif" height="2" width="1" alt="" /></td>
</tr>
<tr>
<td class="hed" style="height: 19px"><div class="mgn">ID</div></td>
<td class="hed" style="height: 19px"><div class="mgn">Name</div></td>
<td class="hed" style="height: 19px"><div class="mgn">PackInfo</div></td>
<td class="hed" style="height: 19px"><div class="mgn">Del</div></td>

</tr>
<tr>
<asp:Repeater ID="Repcurroffers" runat="server" OnItemDataBound="bindcurroffers" >
<ItemTemplate>
<tr class="white" onmouseover="this.className='high';" onmouseout="this.className='white';">
<td class="row"><div class="mgn"><%#Eval("spid")%></div></td>
<td class="row"><div class="mgn"><asp:Literal ID="lblcurroffname" runat="server" /></div></td>
<td class="row"><div class="mgn"><asp:Literal ID="lblcurrLead" runat="server" /></div></td>
<td class="row"><div class="mgn"><asp:LinkButton ID="lnkdel" runat="server" Text="Delete" CommandArgument='<%#Eval("Spid")%>' OnCommand="lnkDelOffer" /></div></td>
</tr>
</ItemTemplate>

</asp:Repeater>
</tr>
</table>
</asp:Panel>

Thanx guys

Hi,

Please change your code to:

<asp:Panel runat="server" ID="pnlcurroffer" GroupingText="<b>Current Offers Info</b>"
Height="400px" Width="350">
<asp:Button ID="btncurrprev" runat="server" CssClass="tbox" Text="<<" OnClick="currprev" />
<asp:Label ID="lblcurrpage" runat="server" />
<asp:Button ID="btncurrnxt" runat="server" CssClass="tbox" Text=">>" OnClick="currlnext" />
<table cellpadding="0" cellspacing="0" border="0" class="main" width="95%">
<tr>
<td colspan="4" class="top line">
<img src="http://pics.10026.com/?src=~../images/spc.gif" height="2" width="1" alt="" /></td>
</tr>
<tr>
<td class="hed" style="height: 19px">
<div class="mgn">
ID</div>
</td>
<td class="hed" style="height: 19px">
<div class="mgn">
Name</div>
</td>
<td class="hed" style="height: 19px">
<div class="mgn">
PackInfo</div>
</td>
<td class="hed" style="height: 19px">
<div class="mgn">
Del</div>
</td>
</tr>
<asp:Repeater ID="Repcurroffers" runat="server" OnItemDataBound="bindcurroffers">
<ItemTemplate>
<tr>
<td colspan="4">
<asp:Panel ID="Panel1" runat="server">

<table>
<tr class="white" onmouseover="this.className='high';" onmouseout="this.className='white';">
<td class="row">
<div class="mgn">
<%#Eval("spid")%>
</div>
</td>
<td class="row">
<div class="mgn">
<asp:Literal ID="lblcurroffname" runat="server" /></div>
</td>
<td class="row">
<div class="mgn">
<asp:Literal ID="lblcurrLead" runat="server" /></div>
</td>
<td class="row">
<div class="mgn">
<asp:LinkButton ID="lnkdel" runat="server" Text="Delete" CommandArgument='<%#Eval("Spid")%>'
OnCommand="lnkDelOffer" /></div>
</td>
</tr>
</table>
</asp:Panel>
<ajaxToolkit:HoverMenuExtender ID="hme1" runat="Server" TargetControlID="Panel1"
PopupControlID="PopupMenu" HoverCssClass="popupHover" PopupPosition="Right" />
<asp:Panel ID="PopupMenu" runat="server" CssClass="popupMenu">
<div style="border: 1px outset white">
<asp:LinkButton ID="LinkButton1" runat="server" />
<br />
<asp:LinkButton ID="LinkButton2" runat="server" />
</div>
</asp:Panel>
</td>
</tr>
</ItemTemplate>
</asp:Repeater>

</table>
</asp:Panel>

Best Regards,


Thank you so much!!!