Extending the built-in Login Control

Posted by Community Admin on 03-Aug-2018 22:18

Extending the built-in Login Control

All Replies

Posted by Community Admin on 17-Jan-2011 00:00

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

Posted by Community Admin on 18-Jan-2011 00:00

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/"
        
    


sample

<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>


close window

<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>


Greetings,
Ivan Dimitrov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

This thread is closed