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

How to programmatically cause RadAjaxManager to update a control.

3 Answers 162 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Samy
Top achievements
Rank 1
Samy asked on 26 Feb 2014, 11:38 PM
Hi I have been having this issue in many development requests. Basically I use RadAjaxManager to update controls on a webform, but sometimes certain code is called on the server that should update a control and I need to cause that control to be upated on the screen from code behind. Is there a way to use the RadAjaxManager to achieve this task?

Thanks

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 27 Feb 2014, 03:05 AM
Hi Samy,

Please have a look into the sample code snippet to achieve your scenario.

ASPX:
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"  DefaultLoadingPanelID="RadAjaxLoadingPanel1">
</telerik:RadAjaxManager>
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Default">
</telerik:RadAjaxLoadingPanel>
<telerik:RadButton ID="RadButton1" runat="server" Text="Click" OnClick="RadButton1_Click">
</telerik:RadButton>
<telerik:RadTextBox ID="RadTextBox1" runat="server" Text="Update">
</telerik:RadTextBox>

C#:
protected void Page_Load(object sender, EventArgs e)
{
    RadAjaxManager1.AjaxSettings.AddAjaxSetting(RadButton1, RadTextBox1);
}
protected void RadButton1_Click(object sender, EventArgs e)
{
    Thread.Sleep(1000);
}

Thanks,
Shinu.
0
Samy
Top achievements
Rank 1
answered on 27 Feb 2014, 05:57 AM
In this scenario the user clicks RadButton1 which updates RadTextBox1 through RadAjaxManager1, but in my scenario there is no user clicking a button. It is just code running on the server that needs to update a control so I still don't know how to achieve that.
 
0
Eyup
Telerik team
answered on 03 Mar 2014, 11:17 AM
Hello Samy,

I'm afraid it is difficult to figure out your exact requirement. Which controls initiate the AJAX Request when you have to execute the mentioned logic? Or it may run on every request regardless of the initiator? Please elaborate on your specific scenario and send us sample screenshots or video demonstrating the desired behavior.

Regards,
Eyup
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the UI for ASP.NET AJAX, subscribe to the blog feed now.
Tags
General Discussions
Asked by
Samy
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Samy
Top achievements
Rank 1
Eyup
Telerik team
Share this question
or