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

using Ajax Manager proxy in user control page and ajax manager in master page.

4 Answers 249 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
sk
Top achievements
Rank 1
sk asked on 20 May 2009, 04:19 AM
hi, i had placing the ajax manager in the master page and the ajax manager proxy in the user control page. Since ajax manager proxy doesn't have ajax request function, i have done the coding by using telerik help as reference. I had successfully calling the ajax manager to the user control page but there is some error for javascript. Can anyone help me on this?

4 Answers, 1 is accepted

Sort by
0
Michael Dunbar
Top achievements
Rank 2
answered on 20 May 2009, 08:10 AM
I'm trying to do something similar and having problems. Can you post your code to show how you have approached this please?
0
Pavlina
Telerik team
answered on 20 May 2009, 09:54 AM
Hello sk,

From the information provided so far I am not able to determine the exact source of the issue you are facing. At this point I will ask you to send us a runnable project. Thus I could do all my best to find a quick resolution of this issue.

Sincerely yours,
Pavlina
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
sk
Top achievements
Rank 1
answered on 21 May 2009, 01:21 AM
hello,
i have use the ajax manager in the master page.
To calling the ajax manager from the user control form, i have using a ajax manager proxy in it page. for the code behind, i had put these code in aspx.cs:

   protected void Page_Load(object sender, EventArgs e)
    {
        RadAjaxManager manager = RadAjaxManager.GetCurrent(Page);
        manager.ClientEvents.OnRequestStart = "onRequestStart";
        manager.ClientEvents.OnResponseEnd = "onResponseEnd";
        manager.AjaxRequest += new RadAjaxControl.AjaxRequestDelegate(manager_AjaxRequest);

    }

these had successfully calling the ajax manager to the user control page and i had call the ajax manager_ajaxrequest function in the user control page. The code is as below:

    protected void manager_AjaxRequest(object sender, Telerik.Web.UI.AjaxRequestEventArgs e)
    {
        //handle the manager AjaxRequest event here
        if (e.Argument == "Rebind")
        {
            grdRegion.MasterTableView.SortExpressions.Clear();
            grdRegion.MasterTableView.GroupByExpressions.Clear();
            grdRegion.Rebind();
        }
        else if (e.Argument == "RebindAndNavigate")
        {
            grdRegion.MasterTableView.SortExpressions.Clear();
            grdRegion.MasterTableView.GroupByExpressions.Clear();
            grdRegion.MasterTableView.CurrentPageIndex = grdRegion.MasterTableView.PageCount - 1;
            grdRegion.Rebind();
        }
        if (e.Argument == "Delete")
        {

            string regionId = Session["idForDelete"] as string;
            Session["idForDelete"] = null;

            SmRegionService smRegionService = new SmRegionService();

            //string regionId = e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["RegionId"].ToString();

            bool success = false;
            success = smRegionService.Delete(Convert.ToInt32(regionId));

            TList<SmRegion> regionList = new TList<SmRegion>();

            regionList = smRegionService.GetAll();

            grdRegion.DataSource = regionList;

            grdRegion.DataBind();

            smRegionService = null;
        }
    }

but there is some javascript when using these. Is there any solution for these?

0
Pavlina
Telerik team
answered on 25 May 2009, 10:00 AM
Hi sk,

I went through your code and it looks fine to me.
In order to help you in resolving the issue you are facing I will ask you to send me a screenshot of the javascript error or at least the error message you received.

More information is available in the following articles:
RadAjax and WebUserControls
Known reasons for error messages
Most Common Mistakes

Sincerely yours,
Pavlina
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Ajax
Asked by
sk
Top achievements
Rank 1
Answers by
Michael Dunbar
Top achievements
Rank 2
Pavlina
Telerik team
sk
Top achievements
Rank 1
Share this question
or