This is a migrated thread and some comments may be shown as answers.

AjaxManager.Redirect(url) Problem.

3 Answers 243 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Cuneyt
Top achievements
Rank 1
Cuneyt asked on 09 May 2014, 06:39 AM
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.

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 09 May 2014, 07:04 AM
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.
0
Cuneyt
Top achievements
Rank 1
answered on 09 May 2014, 10:50 AM
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.
0
Maria Ilieva
Telerik team
answered on 09 May 2014, 02:56 PM
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.

 
Tags
Ajax
Asked by
Cuneyt
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Cuneyt
Top achievements
Rank 1
Maria Ilieva
Telerik team
Share this question
or