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

RadAjaxManager and Usercontrol does not work

1 Answer 370 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Jorge
Top achievements
Rank 1
Jorge asked on 22 Jun 2011, 06:48 PM
I have a UserControl that implements IPostBackEventHandler and I have several problems:

void IPostBackEventHandler.RaisePostBackEvent(string eventArgument)
{
    if (eventArgument.Equals("Refresh", StringComparison.InvariantCultureIgnoreCase))
        Refresh();
}

1) RadAjaxManager Property Builder does not list my control. I must add it manually in the Page_Load event.
2) When I initiate an ajax postback in javascript with the following code it does a normal postback (not ajax postback):
<%= Page.GetPostBackEventReference(FormView.FindControl("anotaciones"), "Refresh") %>

I solved the problem with two "not elegant" solutions:

1) By ajaxfing the whole FormView (totally inefficient!)
2) Or by putting the usercontrol in a RadAjaxPanel and then implementing the Ajax_Request event:
((sender as Control).FindControl("anotaciones") as Anotaciones).Refresh();

Is this a common practice? Or should RadAjaxManager work?
Thanks a lot!

1 Answer, 1 is accepted

Sort by
0
Maria Ilieva
Telerik team
answered on 27 Jun 2011, 02:07 PM
Hello Jorge,

I would suggest you to review the following online resources which elaborates on similar scenarios:
http://www.telerik.com/help/aspnet-ajax/ajax-user-controls.html
http://demos.telerik.com/aspnet-ajax/ajax/examples/manager/usercontrol/defaultcs.aspx

Regards,
Maria Ilieva
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

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