2012-01-10 44 views
0

使用花式框我建了一個photgallery。當用戶點擊一個縮略圖時,一個全尺寸的圖像打開在一個漂亮的盒子裏。在那個漂亮的box popu中,用戶可以提交評論,並可以回覆評論,同意/不同意評論(類似於facebook相冊)。 所有這些工作正常。 我的問題是,當用戶點擊提交按鈕後發生後彈出關閉。我不想讓彈出窗口關閉,但只需要更新內容。我嘗試使用asp:UpdatePanel AJAX控件,但頁面仍然回發,關閉彈出窗口。我不確定idf這是因爲更新面板是在fancybox彈出窗口內。下面是我使用的代碼。任何在解決這個問題上的建議都會很有幫助。asp:updatePanel內fancybox - 不工作

謝謝!

<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> 

回答

0

我建議你使用的HREF 而不是提交ASP按鈕...

一件事,使用AJAX提交,因爲一旦你創建了一個asp控件,它需要你包含runat =「server」,根據我的經驗觸發它後面的代碼並且在按鈕之後回傳。