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

Intresting problem(RadAjaxManager)

4 Answers 38 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
keithtobin
Top achievements
Rank 1
keithtobin asked on 07 Oct 2010, 08:30 AM
I have a master page and want to put the RadAjaxManager on this page, so that when needed
by content pages that it is avalable. When a content page is loaded that dose not require the
script manager or radajaxmanager, I do not want the script manager producing and scripts, this
would mean that for content pages that dont need it, there is no impact on loading that page, it
would be that the scriptmanager or radajax never existed.

I know I could put the script manager and radajaxmanager on only thet page but I have other pages
with 2 or more content sections that require radajaxmanager.

So what I am looking for is a way to be able to turn on and off the script manager and hide there presents by
program code ?

Thanks Keith

4 Answers, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 07 Oct 2010, 11:23 AM
Hi Keith,

Should you need the server or client-side RadAjaxManager functionality (like ResponseScripts collection, ajaxRequest function) you can get the "master" manager instance via Server-Side GetCurrent method from the ContentPage code-behind: 

RadAjaxManager.GetCurrent(Page)

More information is available in the help articles below:
RadAjax and MasterPage
MasterPages: ajaxify and update controls in master and content page
MasterPages: initiating requests from one ContentPlaceHolder and loading/updating controls in another

Sincerely yours,

Pavlina
the Telerik team

 

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
keithtobin
Top achievements
Rank 1
answered on 08 Oct 2010, 07:25 AM
Thanks for the feedback.

I found the answer and I think it is worth sharing.

To be able to enable/disable the generation of scripts by the
RadAjaxmanager or scriptmanager. You can just disable them
then needed from the content page.

By default they ill be disabled on the masterpage and
if the content page needs ajax it will enable them.
This way I dont get unneeded scripts on pages
being created.

0
Pavlina
Telerik team
answered on 08 Oct 2010, 10:28 AM
Hello Keithtobin,

Thank you for sharing your solution with the community. I am sure it would be helpful for anyone searching such functionality.

All the best,
Pavlina
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
erato
Top achievements
Rank 1
answered on 12 Nov 2010, 06:37 PM
This is a great tip! 

I put this into my master page:

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel1" EnableAJAX="false" >

Then in the pages where i needed ajax enabled:

protected void Page_Load(object sender, EventArgs e)
   {
       RadAjaxManager.GetCurrent(this).EnableAJAX = true;


Tags
General Discussions
Asked by
keithtobin
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
keithtobin
Top achievements
Rank 1
erato
Top achievements
Rank 1
Share this question
or