Redirect via Radconfirm

2 posts, 0 answers
  1. Bill
    Bill avatar
    175 posts
    Member since:
    Apr 2010

    Posted 08 Jun 2010 Link to this post

    I want to be able to simply redirect to another page providing the value coming back from the radconfirm is a "Yes". However, when the server side script executes, the page just hangs. What am I missing?

    I have the following code in a server side button click event:
    <code>
    RadAjaxManager1.ResponseScripts.Add("radconfirm('No more EDLogs exist for the remaining Chart files. Do you want to be redirected to the page where you can enter more EDLogs?', confirmCallBackEDLogFn);"); 
    </code>

    I have the following code in my html:
    <code>

    <telerik:RadWindowManager ID="RadWindowManager1" runat="server">
        </telerik:RadWindowManager>

        <script type="text/javascript">
            function confirmCallBackChartFn(arg)
                {
                    if(arg == "Yes")
                        {
                           window.location.href = "../scan/viewchart.aspx"; // Set the url to redirect
                        }
                }
               
            function confirmCallBackEDLogFn(arg)
                {
                    if(arg == "Yes")
                        {
                           window.location.href = "../scan/viewchart.aspx"; // Set the url to redirect
                        }
                }
        </script>

        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" UpdatePanelsRenderMode="Inline">
            <AjaxSettings>
                 <telerik:AjaxSetting AjaxControlID="chkBulk">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="chkBulk" LoadingPanelID="RadAjaxLoadingPanel1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="RadGridEDLogFiles">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadGridEDLogFiles" LoadingPanelID="RadAjaxLoadingPanel1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="chkEDLog">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="chkEDLog" LoadingPanelID="RadAjaxLoadingPanel1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server">
        </telerik:RadAjaxLoadingPanel>
    </code>

  2. Fiko
    Admin
    Fiko avatar
    1406 posts

    Posted 14 Jun 2010 Link to this post

    Hello William,

    In your case I recommend you to use this approach in order to open a radconfirm dialog from the server. Also, you need to change this check:
    function confirmCallBackEDLogFn(arg)
    {
       if(arg == "Yes")
       {
         window.location.href = "../scan/viewchart.aspx"; // Set the url to redirect
       }
    }

    to looks like this :
    function confirmCallBackEDLogFn(arg)
    {
       if(arg)
       {
         window.location.href = "../scan/viewchart.aspx"; // Set the url to redirect
       }
    }

    This is because the radconfirm returns a Boolean value.

    I hope this helps.

    Greetings,
    Fiko
    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top