Using jquery ui dialog to open an existing aspx page
I'm trying to make an aspx page open in a modal way using jquery ui
dialog. I've come across this solution:
$(function () {
$("#dialog").dialog({
autoOpen: false,
modal: true,
height: 600,
open: function (ev, ui) {
$("#myframe").attr('src', 'http://www.jquery.com');
}
});
});
$("#lnkCadastro").click(function () {
$("#dialog").dialog('open');
});
And here's my div which contains an iframe and my anchor element:
<div id="dialog">
<iframe id="myframe" src=""></iframe>
</div>
<span>Não possui cadastro?
<a ID="lnkCadastro" runat="server" href="#">Crie sua
conta</a></span>
My iframe div is inside a form tag in an aspx page. I'd like to show
another aspx page in modal way when the user clicks on this anchor
element. But i can't make it work.
I'm using vs 2012, jquery 1.10.2 and jquery ui (the latest version).
Is there an easy way on doing this? What am i doing wrong here?
No comments:
Post a Comment