Extending the built-in Login Control
I have the Login control placed into a page that opens in a modal window. Is there a way to extend the control so that it closes the modal window and redirects? I set the DestinationPageUrl, but it just redirects within the window.
Thanks,
Alex Lorenz
Hello Alex,
The RadWindow has an event - OnClientClose which you can use to close the window.
function OnClientClose(oWnd, args) //get the transferred arguments var arg = args.get_argument(); if (arg) window.location = "http://www.google.com/" <script type="text/javascript"> function openWin() var oWnd = radopen("Login1", "RadWindow1"); function OnClientClose(oWnd, args) //get the transferred arguments var arg = args.get_argument(); if (arg) window.location = "http://www.google.com/"
</script> <telerik:RadWindowManager ID="RadWindowManager1" ShowContentDuringLoad="false" VisibleStatusbar="false" ReloadOnShow="true" runat="server" Skin="Sunset" EnableShadow="true"> <Windows> <telerik:RadWindow ID="RadWindow1" runat="server" Behaviors="Close" OnClientClose="OnClientClose" NavigateUrl="~/Login1"> </telerik:RadWindow> </Windows> </telerik:RadWindowManager> <button onclick="openWin(); return false;">Open</button><script type="text/javascript"> function GetRadWindow() var oWindow = null; if (window.radWindow) oWindow = window.radWindow; else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow; return oWindow; function returnToParent() var oArg = new Object(); var oWnd = GetRadWindow(); oWnd.close(oArg); </script><button title="Submit" id="close" onclick="returnToParent(); return false;"> Submit</button>