1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / General Discussions / Extending the built-in Login Control

Extending the built-in Login Control

2 posts, 0 answered
  1. Alex
    Alex avatar
    39 posts
    Registered:
    19 Jul 2010
    17 Jan 2011
    Link to this post
    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
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    18 Jan 2011
    Link to this post
    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
2 posts, 0 answered