Take the 2-minute tour ×

I need to open the login.aspx page in a dialog box when the user clicks the 'login' link. I've looked at jQuery UI Dialog, but it looks like it can't open whole pages from a given URL?

Do you guys have any tips to what I can use?

share|improve this question

2 Answers 2

up vote 3 down vote accepted

You can just create an <iframe> and .dialog() it to get what you're after, short a simple. Elijah Manor has a full post with code on how to do this.

Here's a quick version:

$('<iframe src="login.aspx" />').dialog({
   title: 'Login',
   width: 600,
   height: 400,
   modal: true,
}).width(570).height(370); //give it a bit of padding
share|improve this answer
Thanks, this worked great. Would you by any change know how I automatically could close the dialogue box after user was logged in? Since it's IFrame content, I probably cant close the Dialog window from that page? –  Steven Jul 15 '10 at 13:24
@Steven - Give the <iframe> an ID, like id="LoginFrame" then in the child page you can do window.parent.$('#LoginFrame').dialog('destroy').remove() or just .dialog('close') if you don't want to remove it. –  Nick Craver Jul 15 '10 at 13:29

Use an <iframe>.

share|improve this answer

Your Answer


