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

[Solved] Ajax manager not working on a SharePoint Webpart

2 Answers 123 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Phani Alla
Top achievements
Rank 1
Phani Alla asked on 26 Jun 2009, 03:24 PM
Hello, I have a webpart with three rad grid controls, I'm unable to get the radAjaxManager to work. I've added the following code OnInit

protected override void OnInit(EventArgs e)  
        {  
            base.OnInit(e);  
            Page.ClientScript.RegisterStartupScript(typeof(ProjectSearchBuilder), this.ID, "_spOriginalFormAction = document.forms[0].action;_spSuppressFormOnSubmitWrapper=true;", true);  
            if (this.Page.Form != null)  
            {  
                string formOnSubmitAtt = this.Page.Form.Attributes["onsubmit"];  
                if (!string.IsNullOrEmpty(formOnSubmitAtt) && formOnSubmitAtt == "return _spFormOnSubmitWrapper();")  
                {  
                    this.Page.Form.Attributes["onsubmit"] = "_spFormOnSubmitWrapper();";  
                }  
            }  
 
            ScriptManager scriptManager = ScriptManager.GetCurrent(Page);  
            if (scriptManager == null)  
            {  
                scriptManager = new RadScriptManager();  
                Page.Form.Controls.Add(scriptManager);  
            }  
            EnsureChildControls();  
        } 

and the following in the OnLoad Event
protected override void OnLoad(EventArgs e)  
        {   
            base.OnLoad(e);  
            ((RadAjaxManager)FindControl("RadAjaxManager1")).AjaxSettings.AddAjaxSetting(FindControl("_btnSearch"), FindControl("ProjectGrid"));  
            ((RadAjaxManager)FindControl("RadAjaxManager1")).AjaxSettings.AddAjaxSetting(FindControl("_btnSearch"), FindControl("RadGrid2"));  
            ((RadAjaxManager)FindControl("RadAjaxManager1")).AjaxSettings.AddAjaxSetting(FindControl("_btnSearch"), FindControl("RadGrid3"));  
        }  
 
I've added the grid controls and the ajax panel to the page in the CreateChildControls().
am I missing something?

thank you,
Phani

2 Answers, 1 is accepted

Sort by
0
Phani Alla
Top achievements
Rank 1
answered on 26 Jun 2009, 04:09 PM
The problem i have is, the search button click does a full post back every time.
0
Georgi Krustev
Telerik team
answered on 01 Jul 2009, 01:46 PM
Hello Phani,

May I suggest you use the exact code post in this help topic? Let me know if there are some difference between your implementation and the suggested in the help article.

Regards,
Georgi Krustev
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
Phani Alla
Top achievements
Rank 1
Answers by
Phani Alla
Top achievements
Rank 1
Georgi Krustev
Telerik team
Share this question
or