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

Login Form using Window

2 Answers 673 Views
Window
This is a migrated thread and some comments may be shown as answers.
Zachery
Top achievements
Rank 1
Zachery asked on 05 Feb 2018, 03:39 AM

I'm currently using Window as a pop-up login form. A user will click a button on a RadToolbar called "login". The login button is tied to a codebehind event to pop a window that will let a user authenticate to the app. This and the authentication works fine, the user submits their creds, clocks submit and if the creds match then the window is closed.

What I'm trying to figure out how to do is refresh the parent page. The refresh checks if the user is authenticated or now and update the toolbar by removing login and replacing it with logout.

I've been doing some research and cant find the right way to make this work.


2 Answers, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 06 Feb 2018, 11:27 AM

Hi,

The most straightforward approach I can suggest is to:

  1. hook to the OnClientClose event of the RadWindow: https://docs.telerik.com/devtools/aspnet-ajax/controls/window/client-side-programming/events/onclientclose.
  2. initiate a postback on the main page (optionally, by checking the data passed by the content page). You can use the standard __doPostBack() function from WebForms, or .click() a button (it may even be a hidden button) that can easily give you a postback event or even invoke a partial postback.


Regards,

Marin Bratanov
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Zachery
Top achievements
Rank 1
answered on 06 Feb 2018, 10:10 PM

Thanks Marin,

That's what I thought. I have this partially implemented and if I manually refresh the page, it works. I'm just trying to hack out a solution for the onclientclose event.

Thanks for confirming I was going in the right direction sir!

Tags
Window
Asked by
Zachery
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Zachery
Top achievements
Rank 1
Share this question
or