Using fancy box I ahve built a photgallery. When the user clicks on a thumbnail, a full size image opens in a fancy box. In that fancy box popu the user can submit comments and can reply to a comment, agree/disagree to a comment ( similar to facebook photo gallery).
All of these work fine.
My problem is, when the user hits submit button a post back happens and the pop up closes. I dont want the pop up to close, but just need the content within to update. I tried using asp:UpdatePanel AJAX control, but the page still postbacks, closing the popup. i am not sure idf it is because the update panel is within the fancybox popup. below is the code i am using. Any suggestions in fixing this would be fo great help.
Thanks!
<asp:TextBox ID="txtComment" runat="server" Height="40" Width="400" TextMode="MultiLine"></asp:TextBox>
<asp:ImageButton ID="commentSubmitButton" runat="server" Text="Submit" OnClick="SubmitComment" ImageUrl="~/imgs/section/submit.jpg" />
<asp:UpdatePanel runat="server" id="commentsRepeaterUpdatePanel">
<Triggers>
<asp:AsyncPostBackTrigger controlid="commentSubmitButton" eventname="Click" />
</Triggers>
<ContentTemplate>
<asp:Repeater ID="rptComments" runat="server" OnItemDataBound="rptComments_ItemDataBound">
<ItemTemplate>
//Code that Loads the comments, upon OnItemDataBound
</ItemTemplate>
</asp:Repeater>
</ContentTemplate>
I suggest you use a href
instead of asp button for submission…
one more thing, use ajax for submission because once you created an asp control it requires you to include the runat=”server” which according to my experience it triggers the code behind and posts back after especially for buttons.