Search for Sharepoint Examples and Tutorials:   
Banner

Sharepoint Forum

Home » Forum » SharepointRSS Feeds

Use of AJAX in SharePoint

  
  Asked By: Krista Porter         Date: Oct 02, 2006      Category: Sharepoint      Views: 40

Has anyone tried using AJAX in SharePoint? I have a web
part with two dropdownlists. One dropdownlist will have the country
names as values and the other dropdownlist will be populated
with "State" values based on the selected country in the first
dropdownlist.

Basically, the second dropdownlist will be populated
with "State" values based on the selected "Country" value in the first
dropdownlist. And I want this to happen using AJAX, so that the page
is not posted back but the action takes place by retrieving values
after requesting the server.

Tagged:    

 

1 Answer Found

 
Answer #1       Answered By: Stefanie Ruiz          Answered On: Oct 02, 2006       

Depends on what you need, you might use Html control
with Javascript in your web part to achieve the
purpose without touching AJAX.

The basic idea is that the CreateChildControl() method
create all Html controls with embedded logic in the
JavaScript functions (onclick, onchange etc.). The
CreateChildControl() method also loads server side
information to be used in Html controls and JavaScript
functions. But once that is done, everything else is
controlled by the JavaScript which runs on the client
side.

The code can look very ugly.

And it won't work if client needs to interact with
server later because it is hard (impossible without
AJAX?) to get value from an Html control to a web
control. I believe AJAX will come in handy. I hope
someone else will share her/his experience.

 


Your Answer
  • Answer should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].
 

 
Hall of Fame|Facebook|Twitter|LinkedIn|Terms of Use|Privacy Policy|Contact us
RSS Feeds: Articles |  Forum |  New Users |  Activity Log |  Interview FAQ |  Poll |  Hotlinks
Copyright © 2005-2011