Overwrite the LoginWidget. Set DestinationPageUrl dynamically.
Hi,
I want to add some custom code during the login function, in particular i want to redirect the user after login to the previous page.
For example: i'm on page A , i want to download something from this page, but i'm not authorized. Then pops a popup with link to the login page. After successful login i'm back on page A.
For this purpose i want to overwrite the LoginWidged and to set value to"this.DestinationPageUrl" dynamically.
I read about similar issues here and here, but there isn't an example how to overwrite this LoginWidget class.
I create CustomLoginControl.cs file in my project and register as a new custom control, but after rendering it on the page, it didn't work. Login button does not make nothing. I'm not sure what exactly have to do and which of methods have to overwrite.
namespace
SitefinityWebApp.UserControls
public
class
CustomLoginControl : Telerik.Sitefinity.Web.UI.PublicControls.LoginWidget
protected
override
void
Render(System.Web.UI.HtmlTextWriter writer)
this
.DestinationPageUrl =
"http://previousPage.com"
;
base
.Render(writer);
Can you give me an example how to overwrite this class to work properly.
Version: Sitefinity 5, Claims-based authentication
Hi Atanas,
After Sitefinity 5.3 you have all that functionality out of the box. The login widget supports ReturnUrl query parameter and returns the user to the page which was initially requested.
Regards,
Boyko Nistorov
Telerik