AjaxManager.Redirect(url) Problem.

4 posts, 0 answers
  1. Cuneyt
    Cuneyt avatar
    36 posts
    Member since:
    Dec 2011

    Posted 09 May 2014 Link to this post

    ajax manager dont redirect .

    i have master page with ajaxmanager.
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server"  
               OutputCompositeScriptLast="True">
               <Scripts>
                   <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
                   <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
                   <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
               </Scripts>
               <CompositeScript>
                   <Scripts>
                       <asp:ScriptReference NotifyScriptLoaded="true" Path="~/Common/Scripts/jquery-1.9.0.js" />
                        <asp:ScriptReference NotifyScriptLoaded="true" Path="~/Common/Scripts/jquery-migrate-1.2.1.min.js" />
                        <asp:ScriptReference NotifyScriptLoaded="true" Path="~/Common/Scripts/jquery-2.1.1.min.js" />
                       <asp:ScriptReference NotifyScriptLoaded="true" Path="~/Common/Js/mainComp.js" />
                   </Scripts>
               </CompositeScript>
    </telerik:RadScriptManager>

    i have rad ajaxpanel and inside a button that has btnRedirect_Click onclick event at content page.
    my content page redirect code is below:
    protected void btnRedirect_Click(object sender, EventArgs e)
           {
        string url = Functions.RouteUrlToFullUrl(RouteTable.Routes.GetVirtualPath(null, "route", new RouteValueDictionary { { "id", param1}, { "routeC", param2} }).VirtualPath);
                   RadAjaxManager AjaxManager = RadAjaxManager.GetCurrent(Page);              
                   AjaxManager.Redirect(url);
            
           }

    there is nothing. ajaxmanager or ajaxpanel dont redirect.
    Pls help.
    Thanks.

  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 09 May 2014 in reply to Cuneyt Link to this post

    Hi Cuneyt,

    Please try the following C# code snippet which works fine at my end.

    C#:
    protected void radbtnRedirect_Click(object sender, EventArgs e)
    {
        //accessing the ajaxmanager inside the master page
        RadAjaxManager ajaxManager = (RadAjaxManager)this.Master.FindControl("RadAjaxManager1");
        ajaxManager.Redirect("MenuItem.aspx");
    }

    Let me know if you have any concern.
    Thanks,
    Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Cuneyt
    Cuneyt avatar
    36 posts
    Member since:
    Dec 2011

    Posted 09 May 2014 in reply to Shinu Link to this post

    RadAjaxManager AjaxManager = (RadAjaxManager)this.Master.Master.FindControl("AjaxManager1");
     
                   AjaxManager.Redirect(url);
    I used this i had two nested masterpage, i can see ajaxmanager1 at debug. but redirection is not working, it could related my working envirenment but there is no redirection.
    Thank you.
  5. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 09 May 2014 Link to this post

    Hello,

    I would suggest you to register Startup Script through the Script Manager like this:

    ScriptManager.RegisterStartupScript(Page, Page.GetType(), "myFunction", "Javascript:testRedirect();'", true);


    in order to redirect with ajax

    Regards,
    Maria Ilieva
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top