This is a migrated thread and some comments may be shown as answers.

modal popup using window

2 Answers 149 Views
Window
This is a migrated thread and some comments may be shown as answers.
drpcken
Top achievements
Rank 1
drpcken asked on 12 Apr 2009, 06:57 PM
I love the telerik controls.  I've gotten pretty proficient with the grid and other controls, but I want to make a nice login page.  There are two types of people that could possibly login: managers and employees.  When they visit the main page of the site, they'll click a link for either manager or employee depending on which one they are.  I'd like for a modal type window to popup and process the login depending on which link they click.

Manager authentication is stored in one table, employee in another.  If they click the Manger link I want to run manager authentication, and if they click on the employee link I want to process employee authentication.  I can handle the loggin in part but I would like a nice modal style window to popup when they click either link, and process the proper login.  How can I pass the link clicked into a modal window, then show it?

Thanks!

2 Answers, 1 is accepted

Sort by
0
drpcken
Top achievements
Rank 1
answered on 12 Apr 2009, 11:35 PM
Ok I've figured out quite a bit on my own.  I have a window that pops up with a form.  What I need to do is when the submit button is clicked and authentication is successful, to close the rad window and show the parent page, then redirect to the page after login.

If authentication is unsuccessfull I want to show some type of notification in the radwindow.

Thanks!
0
Georgi Tunev
Telerik team
answered on 13 Apr 2009, 01:01 PM
Hi drpcken,

Are you using an asp:login control? If you do, please note that asp:login by design will redirect the user upon successful login to another page that is defined in the web.config or with the DestinationPageURL property. If none of these settings is configured, it actualy loads the same page again. More information on the subject is available in MSDN and other resources like this one for example.
Since the login control redirects the page, it will be shown in the RadWindow itself - our control is basically an IFRAME and behaves just like one. Since I assume you don't want that, I suggest to put the following script in the page to which you intend to redirect your users after successful login:

if (window != window.top) window.top.location.href = window.location.href; 

The logic behind it is simple - if this page is not displayed as a topmost page (e.g directly in the browser) but in some container (like IFRAME / RadWindow /etc.), load it as topmost page.


I hope this information helps. If your scenario differs, please open a support ticket and send me a small sample project that shows your implementation. I will rework it for you so it uses RadWindow.


All the best,
Georgi Tunev
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
Tags
Window
Asked by
drpcken
Top achievements
Rank 1
Answers by
drpcken
Top achievements
Rank 1
Georgi Tunev
Telerik team
Share this question
or