asp.net button in dynamic loaded page in jQuery popup breaks out of popup
<p>This is probably very easy but I cant get it to work as I'd like.</p>

<p>I found this: <a href="http://www.devcurry.com/2010/06/load-page-dynamically-inside-jquery-ui.html" rel="nofollow">http://www.devcurry.com/2010/06/load-page-dynamically-inside-jquery-ui.html</a></p>

<p>I need to load a dynamic lightbox using jQuery and asp.net. This is what I need exactly:
1 - on default.aspx user clicks button
2 - lightbox is shown which dynamically loads page placereview.aspx
3 - user has a few options:
         clicks 'cancel', lightbox is closed
         clicks 'ok', if error, show errors in lightbox, dont close it. if no error close the lightbox again</p>

<p>What I have now is:</p>

<p><em>default.aspx</em></p>

<pre><code>&lt;script type="text/javascript"&gt;
$(function () {
    $('&lt;div&gt;').dialog({
        modal: true,
        close: function (e, i) { $(this).remove(); },
        open: function () {
            $(this).load('sendemail.aspx');
        },
        height: 400,
        width: 400,
        title: 'Dynamically Loaded Page'
    });
});
&lt;/script&gt;
</code></pre>

<p><em>sendemail.aspx</em></p>

<pre><code>&lt;%@ Page Language="VB" AutoEventWireup="false" CodeFile="sendemail.aspx.vb" Inherits="sendemail" %&gt;

&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;

&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;head runat="server"&gt;
&lt;title&gt;&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;form id="form1" runat="server"&gt;
&lt;div&gt;

Here I can send an email!

&lt;/div&gt;
&lt;asp:LinkButton ID="lbtnOk" CssClass="round" Text="&lt;span&gt;Send&lt;/span&gt;" runat="server" /&gt;
&lt;asp:LinkButton ID="lbtnCancel" CssClass="round_grey" Text="&lt;span&gt;Cancel&lt;/span&gt;" runat="server" /&gt;
&lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>What happens is that when I click 'Send', the page which was shown IN the popup now is loaded in the browser..so it breaks out of the modalpopup it was in earlier.
What can I do about this?</p>

<p>Thanks!</p>
