I'm trying to find the best way to make an _AjaxRequest fired from client side java script update select controls on my page that has a masterpage. The control may also be within a user control.
Currently I have a master page with an AjaxManager on it as follows:
I then have a aspx page using the master page my aspx page has a ajaxmanager proxy on it. On the aspx page I have a radbutton that will call a java script function to make an ajaxrequest as follows:
Everything works and the server side code will get called and I attempt to update the label lblupdate. The problem is that it will not update the browser. I was able to get this to work without a master page but when I put the masterpage in the screen will not refresh.
From my codebehind I'm adding the ajaxsetting:
Currently I have a master page with an AjaxManager on it as follows:
<
telerik:RadAjaxManager
ID
=
"RadAjaxManager1"
runat
=
"server"
ClientIDMode
=
"Static"
RequestQueueSize
=
"1"
OnAjaxRequest
=
"RadAjaxManager1_AjaxRequest"
>
<
ClientEvents
OnRequestStart
=
"requestStart"
/>
</
telerik:RadAjaxManager
>
I then have a aspx page using the master page my aspx page has a ajaxmanager proxy on it. On the aspx page I have a radbutton that will call a java script function to make an ajaxrequest as follows:
<
asp:Content
ID
=
"Content2"
ContentPlaceHolderID
=
"MainContent"
runat
=
"Server"
>
<
telerik:RadAjaxManagerProxy
ID
=
"RadAjaxManagerProxy1"
runat
=
"server"
>
</
telerik:RadAjaxManagerProxy
>
<
telerik:RadCodeBlock
runat
=
"server"
>
<
script
type
=
"text/javascript"
>
// Ajax Request
function CallJSFileInitAjaxRequestFromButtonPress()
{
// alert('Start Request');
initAjaxRequest("Pressed");
// alert('End Request');
}
function initAjaxRequest(RequestType)
{
$find("RadAjaxManager1").ajaxRequest(RequestType);
}
</
script
>
</
telerik:RadCodeBlock
>
<
telerik:RadButton
ID
=
"RadButton1"
runat
=
"server"
Text
=
"Click Me"
OnClientClicking
=
"CallJSFileInitAjaxRequestFromButtonPress"
>
</
telerik:RadButton
>
<
asp:Label
ID
=
"lblUpdate"
runat
=
"server"
Text
=
"Loaded..."
></
asp:Label
>
</
asp:Content
>
Everything works and the server side code will get called and I attempt to update the label lblupdate. The problem is that it will not update the browser. I was able to get this to work without a master page but when I put the masterpage in the screen will not refresh.
From my codebehind I'm adding the ajaxsetting:
Telerik.Web.UI.RadAjaxManager myManager;
myManager = (Telerik.Web.UI.RadAjaxManager)Page.Master.FindControl(
"RadAjaxManager1"
);
myManager.AjaxSettings.AddAjaxSetting(Page.Master.FindControl(
"RadAjaxManager1"
), Page.Master.FindControl(
"MainContent"
).FindControl (
"lblUpdate"
));