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

How to "Ajaxify" Radmenu

12 Answers 204 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Bob
Top achievements
Rank 1
Bob asked on 26 Sep 2008, 02:37 PM
Hi,

I just converted my Telerik controls from the classic ASP.NET controls to the ASP.NET Ajax controls.  My question is how do I 'Ajaxify' a Radmenu control.  Previously the menu which is contained on an ASP master page did not flash when selecting from the menu.  Now it does using after upgrading my web app to .NET 3.5 and the new controls.

I guess maybe the question that also needs to be asked or covers this is how do I "Ajaxify" my web project that was previously created before upgrading to the latest ASP.NET Ajax controls.

Thanks in  advance.

Bob

12 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 26 Sep 2008, 02:50 PM
Hi Bob,

I suggest you review the RadAjax online examples. Also, there are a couple of RadMenu examples which show integration with RadAjax:  Related menus and AJAX-enabled context menu.

Feel free to contact us if you need further help.

Greetings,
Peter
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Bob
Top achievements
Rank 1
answered on 26 Sep 2008, 08:28 PM
Peter,

Thanks for your reply but I still don't know how to "Ajaxify" my web app.  Let me explain a little further. 

I had an ASP.NET 2.0 web application that uses a single master page on all the web forms in the app.  On this master page was simply a header table with some labels and a RadMenu below it.  The menu was used to navigate to all the different forms in the app.  When running this app, and selecting a menu item in the .NET 2.0 version, the master page items never "flashed".  They always stayed on the form.  This gave a nice effect in the app.

After converting the app to .NET 3.5 and the new RadMenu control from ASP.NET Ajax, this effect no longer happens.  The entire page flashes each time a new menu item is chosen for a new web form.

Furthermore, whenever sorting any form that has a RadGrid, the entire page flashes as well on the .NET 3.5 app and never did in the .NET 2.0 app.

So I have two questions:

First, can I add an Ajax control on the master page so that all my forms that have this master page will not flash (if so what control do I use, RadAjaxManager, RadAjaxPanel?)

Second, what Ajax control(s) do I add to the forms with the RadGrid?

Thanks in advance.

Bob
0
Bob
Top achievements
Rank 1
answered on 26 Sep 2008, 09:08 PM
Peter,

I wanted to add another point here related to Ajax.  My new upgraded web app had one page that had an Ajax Manager control that is working correctly when I debug.  However, when I access the smart tag on the Ajax Manager control and click configure Ajax control, there are no controls listed in the dialog.  Furthermore, whenever I add an AjaxManager to any other form, the same behavior exists in that no controls are populated when I attempt to configure the Ajax control.

Maybe this additional information gives you more background to help with this matter.

Thanks.
0
Peter
Telerik team
answered on 02 Oct 2008, 01:16 PM
Hello Bob,

Regarding your question on master pages and ajax, the easiest way to ajaxify content pages is to wrap the ContentPlaceHolder of the MasterPage in a RadAjaxPanel:

 <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server">  
            <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">  
            </asp:ContentPlaceHolder> 
        </telerik:RadAjaxPanel> 

Attached is a simple demo project for reference.

This way you can ajaxify not only RadMenu but any other server control.

About the last problem you describe, we are not sure why it occurs at your side. If you can isolate the problem in a simple demo project and send it to us, that would be quite helpful to determine what causes it.



Kind regards,
Peter
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Bob
Top achievements
Rank 1
answered on 02 Oct 2008, 03:50 PM
Hi Peter,

First, let's not worry about the situation with the Ajax Manager not showing the controls.  I believe that it may have to do with the fact that this code is from the classic RadControls.  I will look into this further myself.

As far as your suggestion for adding the RadPanel to the master page, that definitely works, I believe it limits my ablilty to add Ajax Manager on content pages.  It also causes an error on pages that have a Response.Redirect command.  I am looking into this now.  If you know why this is happening please let me know.

Lastly, I need to have controls 'Ajaxified' on multiple web forms and the documentation suggests that I would need RadAjaxManager for this.  My question is should I add a RadAjaxManger to the master page and then use the AjaxProxyManager for the controls within the content page.  Or should I just abandon the AjaxManager on the master page and just use AjaxManager on each web form that needs it.

Thanks in advance.
0
Bob
Top achievements
Rank 1
answered on 02 Oct 2008, 06:08 PM
Peter,

Following up on the issue with the controls not showing up on the Configuration of a RadAjaxManager, it appears that this is the case with a web page that has a master page built in. 

To confirm this, I took the project that you zipped to me and added a RadAjax manager to the form (WebForm1).  I added a couple of controls and when I tried to configure the radAjaxManager through the smart tag, no controls are listed on the ensuing dialog.  To further confirm, I created a new webform using the master page you created, added the RadAjaxManager and a couple of controls and got the same result.

However, when I added a new web form without using a master page, I was able to configure the AjaxManager.  This leads me to believe that the issue I am having with my current web project that has functioning Ajax Manager controls during runtime, but cannot be configured using the smart tag.

Please confirm that you get the same behavior and if so is this a bug or is there a workaround.

Thanks.
0
Iana Tsolova
Telerik team
answered on 03 Oct 2008, 02:56 PM
Hi Bob,

Regarding the problem with the mising controls in the AjaxManagerProperty builder, please review this blog post. If you upgrade your Visual Studio 2008 and .NET Framework to SP1, the issue won't persists.

Now back to ajaxifying:
First of all I suggest that you review this help topic which is very useful when migrating from RadAjax for ASP.NET to RadAjax for ASP.NET AJAX.

Note that with the RadAjax, you may have only one RadAjaxManager per page. So if your RadAjaxManager is in your master I suggest that you use RadAjaxManagerProxy controls in your content pages. The following topics describe further details about RadAjax in Master/Content page scenarios:

http://www.telerik.com/help/aspnet-ajax/ajxajaxmasterpage.html
http://www.telerik.com/help/aspnet-ajax/ajax-manager-proxy.html
http://www.telerik.com/help/aspnet-ajax/ajxredirectingtoanotherpage.html

Let us know if this helps and if you need further directions.

All the best,
Iana
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Bob
Top achievements
Rank 1
answered on 03 Oct 2008, 09:13 PM
Iana,

OK, we're almost there.  I updated VS2008 to SP1.  That solved the problem with the configuration dialog to display the controls.

Second, I added a RadAjaxPanel to my Master Page and configured it.  This does "ajaxify" all of my pages.  I also changed the existing web forms that had AjaxManagers on them to be RadAjaxManagerProxy controls and this is working.

The final issues is with all of my pages that have a Response.Redirect() command.  Anytime issuing this causes an error.  Here is the error:

Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled.
Details: Error parsing near '
<!DOCTYPE html PUB'.

I followed the directions for issuing the following command to replace the Response.Redirect command:

RadAjaxManager

.GetCurrent(Page).Redirect("page1.aspx");


This causes an error as the object has not been initialized.  Please advise as to what I am missing here.

Thanks again.
0
Iana Tsolova
Telerik team
answered on 06 Oct 2008, 12:40 PM
Hi Bob,

If you have placed RadAjaxPanel in the master page to update all page content, then you do not need RadAjaxManagerProxy controls in the content pages. Also in this case try redirecting as follows:

RadAjaxPanel1.Redirect("page1.aspx");  
 

In case you have placed RadAjaxManager in the master page and RadAjaxManagerProxy controls in the content page, you should not update the whole page content from the master page, but just the necessary controls situated in the master page. And the RadAjaxManagerProxy is to update controls in a certain content page.

The error you receive might be because you are calling the Response.Write() method in your pages, or you have calls to response filters,  HttpModules, or enabled tracing.

Check it out and let me know how it goes.
 
Greetings,
Iana
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Bob
Top achievements
Rank 1
answered on 06 Oct 2008, 01:13 PM
Iana,

Here is what I got from your last reply.  If I put a RadAjaxManager in my master page, I still need to put a RadAjaxManagerProxy on each content page to make Ajax work.  If this is the case, then I see no benefit or reason to putting a RadAjaxManager on a master page as I would just put the AjaxManager on each content page that needs it.  This holds up as I have tried this and putting the RadAjaxManager on my master page does not cause any errors when redirecting, etc. but it also has no Ajax effect.

As far as the RadAjaxPanel is concerned, putting this on the master page does provide the Ajax effect on my forms that have RadGrids, but it causes errors every time I issue a Response.Redirect command.  Your recommendation is to use the RadAjaxPanel1.Redirect command, however, this command is not available on the content page.  Do I need to instantiate something from the content page to access the master page object?
0
Accepted
Iana Tsolova
Telerik team
answered on 06 Oct 2008, 02:51 PM
Hi Bob,

Yes, in the content page try finding the RadAjaxPanel of the master page.

RadAjaxPanel ajaxPanel = Master.FindControl("RadAjaxPanel1"as RadAjaxPanel; 

Let me know if this helps.
 
Greetings,
Iana
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Bob
Top achievements
Rank 1
answered on 06 Oct 2008, 07:52 PM
Iana,

Thanks for the answer on instantiating the AjaxPanel object.  Unfortunately, I have many Response.Redirect statements that can be updated but I am using a framework that has other built in Response.Redirect statements that I can't access.  In order to bypass these I will have to re-write more code to handle this, which might not be worth it.

For now, I will close this thread.

Thanks again for your help.

Bob
Tags
Menu
Asked by
Bob
Top achievements
Rank 1
Answers by
Peter
Telerik team
Bob
Top achievements
Rank 1
Iana Tsolova
Telerik team
Share this question
or