Problem with open another web page after close radwindow

2 posts, 0 answers
  1. Fabio Cirillo
    Fabio Cirillo avatar
    181 posts
    Member since:
    Jan 2010

    Posted 24 Dec 2012 Link to this post

    hi,
    i've a index page with i open a radwindow. Into radwindow load another page that i use to see the messager box. Into this page there's a button that i use to load another web page out this radwindow. With IE 8 and IE 9 all function, with chrome nto function....I post my code.

    Index page:
    <script type="text/javascript">
    // ritorna valore selezionato Anagrafica
    function LoadProfilo(sender, eventArgs) {
    var arg = eventArgs.get_argument();
    if (arg == 1) {
    window.location.href("profile.aspx");
    }
    }
    </script>
    <telerik:RadWindow ID="RadWindowProfileconfirm" runat="server"
    ShowContentDuringLoad="false" Width="435px"
    Height="166px" Title="Aggiornamento profilo" Behaviors="None"
    MaxHeight="166" MaxWidth="435" Modal="True" Behavior="None"
    Font-Names="Verdana" Font-Size="Small" IconUrl="/image/iconlogo.png"
    ToolTip="Aggiornamento profilo" OnClientClose="LoadProfilo"
    VisibleStatusbar="False" NavigateUrl="register_step2.aspx" Skin="Simple"
    ReloadOnShow="True">
    </telerik:RadWindow>

    code be hinde i use to load this radwindow:

    Dim script As String = "function f(){$find(""" + RadWindowProfileconfirm.ClientID + """).show(); Sys.Application.remove_load(f);}Sys.Application.add_load(f);"
    ScriptManager.RegisterStartupScript(Page, Page.GetType(), "key", script, True)


    code radwindow to close the 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 Close_and_Load() {
            var arg = new Object();
            arg = 1
            GetRadWindow().close(arg);
        }
    </script>

    Protected Sub ImgBtncontinua_Click(sender As Object, e As System.Web.UI.ImageClickEventArgs) Handles ImgBtncontinua.Click
        ScriptManager.RegisterStartupScript(Page, Me.GetType, "close", "Close_and_Load();", True)
    End Sub

    please help me




  2. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3712 posts

    Posted 26 Dec 2012 Link to this post

    Hi Fabio,

    The problem is a JavaScript error that prevents your navigation. The window.location.href property is a property, not a function, so the syntax you should use is the following:
    if (arg == 1)
    {
        window.location.href = "profile.aspx";
    }



    Greetings,
    Marin Bratanov
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top