Hi Telerik,
After a week of researching this topic it seems that most people are confused about how to use RadAjaxManagerProxy when creating MasterPage/ContentPage sites and WebUserControls.
The problem with not being able to insert a RadAjaxManager in a ContentPage/UserControl is that if you call the clientside function ajaxRequest your call is made to the RadAjaxManager server side function, which you have no control over when you're developing the contentpage or usercontrol. We need to be able to fire callbacks and catch them in the contentpage or webusercontrol.
I know you can use ajaxRequestWithTarget but this has two problems - it requires you to register the expected postback variables in the Page or UserControl Render function as follows:
And then you have to catch the event on the server side in RaisePostBackEvent - which implies that ajaxRequestWithTarget does a postback, not a callback like ajaxRequest, which is less efficient. The reason you need to register the expected postback variables is because if you don't, you'll get a security error from Asp.Net: "Sys.WebForms.PageRequestManagerServerErrorException: Invalid postback or callback argument" - meaning that ASP is preventing this postback because it doesn't know the data being posted since it wasn't in the ViewState for the target specified in ajaxRequestWithTarget. Also, it's not an elegant solution when you have to add a hidden button to your page which does the postback for you.
Most developers are now moving to nice elegant jQuery solutions that make callbacks everywhere, and if RadAjax does not have an elegant way to make callbacks simple then it's not a workable solution.
I really like the simple way you can make a callback via the RadAjaxManager, but we really need this functionality in the RadAjaxManagerProxy as well!
Dimitri
After a week of researching this topic it seems that most people are confused about how to use RadAjaxManagerProxy when creating MasterPage/ContentPage sites and WebUserControls.
The problem with not being able to insert a RadAjaxManager in a ContentPage/UserControl is that if you call the clientside function ajaxRequest your call is made to the RadAjaxManager server side function, which you have no control over when you're developing the contentpage or usercontrol. We need to be able to fire callbacks and catch them in the contentpage or webusercontrol.
I know you can use ajaxRequestWithTarget but this has two problems - it requires you to register the expected postback variables in the Page or UserControl Render function as follows:
Protected
Overrides
Sub
Render(
ByVal
writer
As
System.Web.UI.HtmlTextWriter)
Page.ClientScript.RegisterForEventValidation(cmdProjectSelected.UniqueID,
"2"
)
Page.ClientScript.RegisterForEventValidation(cmdProjectSelected.UniqueID,
"3"
)
Page.ClientScript.RegisterForEventValidation(cmdProjectSelected.UniqueID,
"4"
)
Page.ClientScript.RegisterForEventValidation(cmdProjectSelected.UniqueID,
"5"
)
MyBase
.Render(writer)
End
Sub
And then you have to catch the event on the server side in RaisePostBackEvent - which implies that ajaxRequestWithTarget does a postback, not a callback like ajaxRequest, which is less efficient. The reason you need to register the expected postback variables is because if you don't, you'll get a security error from Asp.Net: "Sys.WebForms.PageRequestManagerServerErrorException: Invalid postback or callback argument" - meaning that ASP is preventing this postback because it doesn't know the data being posted since it wasn't in the ViewState for the target specified in ajaxRequestWithTarget. Also, it's not an elegant solution when you have to add a hidden button to your page which does the postback for you.
Most developers are now moving to nice elegant jQuery solutions that make callbacks everywhere, and if RadAjax does not have an elegant way to make callbacks simple then it's not a workable solution.
I really like the simple way you can make a callback via the RadAjaxManager, but we really need this functionality in the RadAjaxManagerProxy as well!
Dimitri