Mark Carpenter
Mark Carpenter

Reputation: 17775

Do Ajax and ASP.NET MasterPages mix?

Has anyone had experience using these two technologies in tandem? What are (if any) the major difficulties in getting the two to cooperate? How would a site using these technologies be different than a normal ASP.NET Web Application with Ajax?

Thanks!

Upvotes: 4

Views: 1773

Answers (4)

etsuba
etsuba

Reputation: 151

In addition to declaring the ScriptManager on the Master Page and ScriptManagerProxy on the content pages, it is a good practice to put all the JavaScript files in a separate dll so you have all your resources separate from the rest of the project. Having separate debug and release versions (with white spaces removed) of the Javascript files gives you a good performance boost.

Upvotes: 0

Thomas Hansen
Thomas Hansen

Reputation: 5513

IT depends on what Ajax Framework you're talking about, for ASP.NET AJAX you need to mess around with ScriptManager(Proxy) which complicates it a little bit, but not so that it's very difficult...

The samples of Ra-Ajax are mostly all using MasterPages, without the needs to fiddle around with ScriptManager or ScriptManagerProxy. But Ra-Ajax builds on a completely different architecture then ASP.NET AJAX...

BTW, I work with Ra-Ajax and can hardly be defined as "neutral"...

Upvotes: 1

TheTXI
TheTXI

Reputation: 37905

I've used Master Pages and ASP.NET AJAX together without issues. You can either use the script manager on your content placeholders or use a single scriptmanager in your master page, but then you have to remember to use the ScriptManagerProxy in the content areas to get the proper functionality.

Upvotes: 2

Dave Ward
Dave Ward

Reputation: 60580

Yes, they work well together.

The only thing to watch out for is if you have a ScriptManager on the Master, you can't declare another in Content pages.

If you want to register scripts and services through the ScriptManager on Content pages, you'll need to use a ScriptManagerProxy control instead. It's a control specifically designed for the Master/Content scenario.

Upvotes: 11

Related Questions