AJAX "After the Fact"

  • Thread starter Thread starter Jonathan Wood
  • Start date Start date
J

Jonathan Wood

Can anyone point me to any good resources on adding AJAX to a page once the
page has already been created? I know VS2008 has options to add AJAX pages,
but I didn't select those options when the pages were created.

Thanks.

Jonathan
 
Jonathan Wood said:
Can anyone point me to any good resources on adding AJAX to a page once
the page has already been created? I know VS2008 has options to add AJAX
pages, but I didn't select those options when the pages were created.

Thanks.

Jonathan
I'd create a new Ajax web site. Take a look at the web.config and copy the
Ajax stuff into your old config, basically anything that's not there
previously. You can then add a ScriptManager to the web form and you're set.
 
Jonathan Wood said:
Can anyone point me to any good resources on adding AJAX to a page once
the page has already been created? I know VS2008 has options to add AJAX
pages, but I didn't select those options when the pages were created.

Thanks.

Jonathan

Check out this site. Has great videos to tell you all about ajax

http://www.asp.net/AJAX/documentation/

LS
 
You must need to add script control to the page....
But you must change web.config once to support AJAX (in VS2005 ) in VS 2008
it's there by default I believe.

George.
 
Thanks. Yeah, that site has a lot of information about AJAX. Couldn't find
where it talked about adding it after the fact though.
 
I really dislike this. In VS2008, my web.config files are automatically
loaded with tons of stuff. Then, when I need to deploy my app and create a
"live" version of the config file, it's nearly impossible to strip out stuff
I don't need or don't want (or determine which is which). The idea of trying
to copy everything from one config file to another that is not already in
the target file would not only be an enormous task that would be very
tedious and prone to errors, but it would seem like it would be undesirable
as well.

The web.config file is a great idea but I can see now it's going to grow
into a monster just like the Windows registry did.

I can't believe adding AJAX to an existing page is going to be this much
trouble.

Thanks.
 
re:
!> I can't believe adding AJAX to an existing page is going to be this much trouble

It's not.

The easiest way I've found to do that is to create
a new Ajax application, and saving the web.config file.

All you have to do then is copy and paste the contents
of the web.config to any non-Ajax application's web.config.




Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
 
Juan,
!> I can't believe adding AJAX to an existing page is going to be this
much trouble

It's not.

The easiest way I've found to do that is to create
a new Ajax application, and saving the web.config file.

All you have to do then is copy and paste the contents
of the web.config to any non-Ajax application's web.config.

As I mentioned previously, I find working with the web.config file can be
unwieldy. I've spent a LOT of time tweaking the two versions of web.config
(development and deployed versions) for this particular application. There's
no way I'd copy and paste the entire contents of a brand new web.config
file. And I have no idea how readily I'll be able to determine what part of
the config file is AJAX related.

Surely others have done this before. I just can't believe it's this much
trouble.
 
Jonathan Wood said:
Juan,


As I mentioned previously, I find working with the web.config file can be
unwieldy. I've spent a LOT of time tweaking the two versions of web.config
(development and deployed versions) for this particular application.
There's no way I'd copy and paste the entire contents of a brand new
web.config file. And I have no idea how readily I'll be able to determine
what part of the config file is AJAX related.

Surely others have done this before. I just can't believe it's this much
trouble.

The video you want to look at for hints is:

http://www.asp.net/learn/ajax-videos/video-81.aspx

LS
 
re:
!> I just can't believe it's this much trouble

Again, it's not.

All you need to determine is whether system.web.extensions
and the Script Manager are installed.

See : http://msdn.microsoft.com/en-us/library/bb907614.aspx
for what you need to look for.

As far as the actual web.config lines needed, they are :

1.
<sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup,
System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">

2.
<add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>

2a.
dependentAssembly...
assemblyIdentity name="System.Web.Extensions.Design

3.
....and the lines which refer to the "ScriptHandlerFactory", "ScriptHandlerFactoryAppServices" and "ScriptResource"

That's it...

All the rest of the stuff in web.config is other .Net 3.5-related.

But, again, the best way to handle this is not to perform surgery
on an existing app but, rather, to create a new Ajax-enabled app
and add whatever functionality you have in your Ajax-less app.

You can't go wrong with that.



Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
 
Back
Top