views:

125

answers:

1

Hello, first of all: I'm new to Asp.Net MasterPages and jQuery. I have a Asp.Net Project with one MasterPage. I have used this menu for navigation. It's in the header of the MasterPage. Is it possible with Ajax to change the Content-Page from this menu without having the whole MasterPage reloaded(including the Menu)?

EDIT: perhaps this link describes my problem better: http://forums.asp.net/t/1046795.aspx Is iframe an alternative and when yes, does MasterPages make sense anymore when using iframes?

EDIT: Kervin and this page leads me on the right track.

+1  A: 

Yes. Definitely.

You can do this using only jQuery, which I would recommend. Or you can use an ASP.Net callback and UpdatePanel.

For instance, your Menu's links could all be jQuery click event handlers that would update parts of your content page by id or class using jQuery.ajax().

Also see the question "How to use JQuery, select element by ID and ASP.NET without putting ctl00_ everywhere in the code". For a basic intro in using the ClientID property so your server controls will work with jQuery event handlers.

kervin
Thank you for the answer. I cant check now if your approach works, i will try it later. But i'm still not sure if you understood what i wanted to achieve and where my problems are. Perhaps this thread describes it better than me: http://forums.asp.net/t/1046795.aspxI dont know if jQuery.ajax is an option but ajax+UpdatePanel is not when redirecting the content to another page(for what a navigation menu is for).
Tim Schmelter
I think I got that initially. The jQuery.ajax() approach simply fills a pre-existing empty *div* with the contents returned from your content page URL. In essence, your content page can simply be that single, empty div. Not sure if that makes sense. The AJAX call gets the correct content based on the menu item, then populates that main div.
kervin