This is probably very easy but I cant get it to work as I’d like.
I found this: http://www.devcurry.com/2010/06/load-page-dynamically-inside-jquery-ui.html
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
What I have now is:
default.aspx
<script type="text/javascript">
$(function () {
$('<div>').dialog({
modal: true,
close: function (e, i) { $(this).remove(); },
open: function () {
$(this).load('sendemail.aspx');
},
height: 400,
width: 400,
title: 'Dynamically Loaded Page'
});
});
</script>
sendemail.aspx
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="sendemail.aspx.vb" Inherits="sendemail" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
Here I can send an email!
</div>
<asp:LinkButton ID="lbtnOk" CssClass="round" Text="<span>Send</span>" runat="server" />
<asp:LinkButton ID="lbtnCancel" CssClass="round_grey" Text="<span>Cancel</span>" runat="server" />
</form>
</body>
</html>
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?
Thanks!
You could get the response HTML of sendemail.aspx and use the JQuery .html function to write to a DIV within your dialog.