SlideShare uma empresa Scribd logo
1 de 20
Spicing Up Web Parts using AJAX and Client Object Model Randy Williams Synergy rwilliams@synergyonline.com
About the Speaker US-West Coast Manager for Synergy Based in San Diego, California Consultant/Trainer/Author SharePoint MVP Specialty in architecting solutions Blog: www.synergyonline.com/randy Twitter: @tweetraw
Agenda AJAX Custom Web Services Client Object Model jQuery
How AJAX Works AJAX consists of JavaScript, DHTML and XMLHTTP XMLHTTPRequest object Acts as a web service client Used instead of a full postback Web server processes request and sends back response to browser Browser receives the response and updates the page dynamically
Using AJAX in SP2010 No configuration changes needed Built into web.config Built into v4.master Two primary ways Using UpdatePanel control (basic) Calling web services (advanced)
UpdatePanel Part of ASP.NET 3.5 Easiest way to add AJAX capability Most server-side events run as partial postbacks For SharePoint, use conditional mode up.UpdateMode= UpdatePanelUpdateMode.Conditional; Simple, but limited
Demo Using Update Panel
Calling Web Services Using AJAX, the browser can directly call into Web Services More powerful than UpdatePanel JSON is used to encode messages AJAX engine does most of the hard work Depending on the method used, OOB Web Services will not work Custom ones can be used
Creating Custom Web Services Create new WCF Service App project Write web service Configure a web.config for web service Dynamic bindings will not work with AJAX enableWebScript endpoint behavior – allows it to be called from AJAX client Deploy within 14SAPI
Demo Using AJAX to Call Custom Web Service
Client Object Model Working with SharePoint from client applications ECMAScript (JavaScript) Silverlight .NET Managed Easier than calling web services directly Provides a subset of the functionality available in the server object model Designed to work with data within a site collection
The ClientContext Object ClientContext is your handle to all other objects Site, Web, List, Item, File Optimizes communication to server by batching requests Typical usage: Define a query to retrieve or modify SharePoint objects Pass the query to one of the ClientContext’s Load methods Use ClientContext to execute the query Work with results returned
Demo Client OM from Silverlight Web Part
Session Heads-Up In Raphael 1, tomorrow at 1:45pm… 	Randy Williams 	SharePoint 2010: Developing with 	Data Technologies
Using jQuery Multi-purpose JavaScript library With it, you will write less JavaScript  Cross-browser support Create interactive and usable apps No need to deploy assemblies Works great in sandboxed web parts Hundreds of jQuery plugins
Where to Store these .js Libraries? Deploy as a module-type feature Works in both farm and sandboxed WSP Copy manually to designed libraries e.g. SiteAssets Shared or individual instances? Best to not rename file e.g. keep as jquery-1.5.1.js
Demo Using jQuery
Using SPServices Two primary functions Allows jQuery to easily call SharePoint OOB web services ListFormWebPart enhancements Download from http://spservices.codeplex.com/ Use when Client OM is insufficient
Demo Using jQuery and SPServices
Your Feedback is Important Please fill out a session evaluation form. Thank you!

Mais conteúdo relacionado

Mais procurados

ASP.NET Overview - Alvin Lau
ASP.NET Overview - Alvin LauASP.NET Overview - Alvin Lau
ASP.NET Overview - Alvin Lau
Spiffy
 
New microsoft office power point presentation
New microsoft office power point presentationNew microsoft office power point presentation
New microsoft office power point presentation
teach4uin
 
Asp.net server controls
Asp.net server controlsAsp.net server controls
Asp.net server controls
Raed Aldahdooh
 

Mais procurados (20)

Pros and Cons of developing a Thick Clientside App
Pros and Cons of developing a Thick Clientside AppPros and Cons of developing a Thick Clientside App
Pros and Cons of developing a Thick Clientside App
 
Ajax
AjaxAjax
Ajax
 
ASP.NET Overview - Alvin Lau
ASP.NET Overview - Alvin LauASP.NET Overview - Alvin Lau
ASP.NET Overview - Alvin Lau
 
MSDN Sessions 032817 - Azure Functions
MSDN Sessions 032817 - Azure FunctionsMSDN Sessions 032817 - Azure Functions
MSDN Sessions 032817 - Azure Functions
 
Developing Sandbox Solutions
Developing Sandbox SolutionsDeveloping Sandbox Solutions
Developing Sandbox Solutions
 
Access SharePoint Remotely
Access SharePoint RemotelyAccess SharePoint Remotely
Access SharePoint Remotely
 
Introduction to ASP.NET MVC
Introduction to ASP.NET MVC Introduction to ASP.NET MVC
Introduction to ASP.NET MVC
 
New microsoft office power point presentation
New microsoft office power point presentationNew microsoft office power point presentation
New microsoft office power point presentation
 
360suite datasheet for SAP BusinessObjects
360suite datasheet for SAP BusinessObjects360suite datasheet for SAP BusinessObjects
360suite datasheet for SAP BusinessObjects
 
Internet without internet
Internet without internetInternet without internet
Internet without internet
 
From PHP to React - case study
From PHP to React - case studyFrom PHP to React - case study
From PHP to React - case study
 
All About Asp Net 4 0 Hosam Kamel
All About Asp Net 4 0  Hosam KamelAll About Asp Net 4 0  Hosam Kamel
All About Asp Net 4 0 Hosam Kamel
 
ECS19 - Ingo Gegenwarth - Running Exchange in large environment
ECS19 - Ingo Gegenwarth -  Running Exchangein large environmentECS19 - Ingo Gegenwarth -  Running Exchangein large environment
ECS19 - Ingo Gegenwarth - Running Exchange in large environment
 
SP2010 Developer Tools
SP2010 Developer ToolsSP2010 Developer Tools
SP2010 Developer Tools
 
Asp.net server controls
Asp.net server controlsAsp.net server controls
Asp.net server controls
 
Single page application
Single page applicationSingle page application
Single page application
 
Single page application
Single page applicationSingle page application
Single page application
 
Single page App
Single page AppSingle page App
Single page App
 
Meteor Revolution: From DDP to Blaze Reactive Rendering
Meteor Revolution: From DDP to Blaze Reactive Rendering Meteor Revolution: From DDP to Blaze Reactive Rendering
Meteor Revolution: From DDP to Blaze Reactive Rendering
 
Single page applications with backbone js
Single page applications with backbone jsSingle page applications with backbone js
Single page applications with backbone js
 

Semelhante a Spicing up SharePoint web parts

DevNext - Web Programming Concepts Using Asp Net
DevNext - Web Programming Concepts Using Asp NetDevNext - Web Programming Concepts Using Asp Net
DevNext - Web Programming Concepts Using Asp Net
Adil Mughal
 
SharePoint 2007 Presentation
SharePoint 2007 PresentationSharePoint 2007 Presentation
SharePoint 2007 Presentation
Ajay Jain
 

Semelhante a Spicing up SharePoint web parts (20)

4 - Silverlight y SharePoint, por Rodrigo Diaz y Mauricio Angulo
4 - Silverlight y SharePoint, por Rodrigo Diaz y Mauricio Angulo4 - Silverlight y SharePoint, por Rodrigo Diaz y Mauricio Angulo
4 - Silverlight y SharePoint, por Rodrigo Diaz y Mauricio Angulo
 
DevNext - Web Programming Concepts Using Asp Net
DevNext - Web Programming Concepts Using Asp NetDevNext - Web Programming Concepts Using Asp Net
DevNext - Web Programming Concepts Using Asp Net
 
SharePoint 2007 Presentation
SharePoint 2007 PresentationSharePoint 2007 Presentation
SharePoint 2007 Presentation
 
Usability AJAX and other ASP.NET Features
Usability AJAX and other ASP.NET FeaturesUsability AJAX and other ASP.NET Features
Usability AJAX and other ASP.NET Features
 
ASP.NET Lecture 1
ASP.NET Lecture 1ASP.NET Lecture 1
ASP.NET Lecture 1
 
Ajax
AjaxAjax
Ajax
 
Walther Ajax4
Walther Ajax4Walther Ajax4
Walther Ajax4
 
ASP.NET Presentation
ASP.NET PresentationASP.NET Presentation
ASP.NET Presentation
 
ASP.NET OVERVIEW
ASP.NET OVERVIEWASP.NET OVERVIEW
ASP.NET OVERVIEW
 
Web Center Services and Framework
Web Center Services and  FrameworkWeb Center Services and  Framework
Web Center Services and Framework
 
Ajax Ppt 1
Ajax Ppt 1Ajax Ppt 1
Ajax Ppt 1
 
Single Page Apps
Single Page AppsSingle Page Apps
Single Page Apps
 
Ajax
AjaxAjax
Ajax
 
Lessons from the Trenches: Engineering Great AJAX Experiences
Lessons from the Trenches: Engineering Great AJAX ExperiencesLessons from the Trenches: Engineering Great AJAX Experiences
Lessons from the Trenches: Engineering Great AJAX Experiences
 
Lessons
LessonsLessons
Lessons
 
Asp dot net long
Asp dot net longAsp dot net long
Asp dot net long
 
Advanced SharePoint Web Part Development
Advanced SharePoint Web Part DevelopmentAdvanced SharePoint Web Part Development
Advanced SharePoint Web Part Development
 
AJAX
AJAXAJAX
AJAX
 
Tutorial, Part 2: SharePoint 101: Jump-Starting the Developer by Rob Windsor ...
Tutorial, Part 2: SharePoint 101: Jump-Starting the Developer by Rob Windsor ...Tutorial, Part 2: SharePoint 101: Jump-Starting the Developer by Rob Windsor ...
Tutorial, Part 2: SharePoint 101: Jump-Starting the Developer by Rob Windsor ...
 
ASP.NET MVC and ajax
ASP.NET MVC and ajax ASP.NET MVC and ajax
ASP.NET MVC and ajax
 

Mais de Randy Williams

Integrating SharePoint with Exchange-2013
Integrating SharePoint with Exchange-2013Integrating SharePoint with Exchange-2013
Integrating SharePoint with Exchange-2013
Randy Williams
 
Governance - how does information & security drive your architecture
Governance - how does information & security drive your architectureGovernance - how does information & security drive your architecture
Governance - how does information & security drive your architecture
Randy Williams
 

Mais de Randy Williams (20)

Architecting Solutions and Systems – Randy’s Secrets to Success
Architecting Solutions and Systems – Randy’s Secrets to SuccessArchitecting Solutions and Systems – Randy’s Secrets to Success
Architecting Solutions and Systems – Randy’s Secrets to Success
 
An IT Pro Guide to Deploying and Managing SharePoint 2013 Apps
An IT Pro Guide to Deploying and Managing SharePoint 2013 AppsAn IT Pro Guide to Deploying and Managing SharePoint 2013 Apps
An IT Pro Guide to Deploying and Managing SharePoint 2013 Apps
 
Integrating SharePoint with Exchange-2013
Integrating SharePoint with Exchange-2013Integrating SharePoint with Exchange-2013
Integrating SharePoint with Exchange-2013
 
Governing and managing hybrid SharePoint environments
Governing and managing hybrid SharePoint environmentsGoverning and managing hybrid SharePoint environments
Governing and managing hybrid SharePoint environments
 
When governance lacks compliance
When governance lacks complianceWhen governance lacks compliance
When governance lacks compliance
 
The Future of Social Collaboration
The Future of Social CollaborationThe Future of Social Collaboration
The Future of Social Collaboration
 
Getting Started with SharePoint 2013 Apps
Getting Started with SharePoint 2013 AppsGetting Started with SharePoint 2013 Apps
Getting Started with SharePoint 2013 Apps
 
Building the next generation of browser apps today
Building the next generation of browser apps todayBuilding the next generation of browser apps today
Building the next generation of browser apps today
 
SQL Server 2012 and SharePoint 2010: Reporting Nirvana
SQL Server 2012 and SharePoint 2010: Reporting NirvanaSQL Server 2012 and SharePoint 2010: Reporting Nirvana
SQL Server 2012 and SharePoint 2010: Reporting Nirvana
 
How governance drives your information and security architecture
How governance drives your information and security architectureHow governance drives your information and security architecture
How governance drives your information and security architecture
 
Sizing your Content Databases: Understanding the Limits
Sizing your Content Databases: Understanding the LimitsSizing your Content Databases: Understanding the Limits
Sizing your Content Databases: Understanding the Limits
 
SharePoint Online and the Cloud
SharePoint Online and the CloudSharePoint Online and the Cloud
SharePoint Online and the Cloud
 
Enforcing SharePoint Governance
Enforcing SharePoint GovernanceEnforcing SharePoint Governance
Enforcing SharePoint Governance
 
Migrating to Office 365
Migrating to Office 365Migrating to Office 365
Migrating to Office 365
 
Governance - how does information & security drive your architecture
Governance - how does information & security drive your architectureGovernance - how does information & security drive your architecture
Governance - how does information & security drive your architecture
 
Understanding SharePoint Governance
Understanding SharePoint GovernanceUnderstanding SharePoint Governance
Understanding SharePoint Governance
 
Why I Use SharePoint
Why I Use SharePointWhy I Use SharePoint
Why I Use SharePoint
 
Guiding a Successful SharePoint Implementation
Guiding a Successful SharePoint ImplementationGuiding a Successful SharePoint Implementation
Guiding a Successful SharePoint Implementation
 
Plugging holes in your SharePoint 2010 disaster recovery strategy
Plugging holes in your SharePoint 2010 disaster recovery strategyPlugging holes in your SharePoint 2010 disaster recovery strategy
Plugging holes in your SharePoint 2010 disaster recovery strategy
 
Using Visual Studio to Build SharePoint 2010 Solutions
Using Visual Studio to Build SharePoint 2010 SolutionsUsing Visual Studio to Build SharePoint 2010 Solutions
Using Visual Studio to Build SharePoint 2010 Solutions
 

Último

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 

Último (20)

Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 

Spicing up SharePoint web parts

  • 1. Spicing Up Web Parts using AJAX and Client Object Model Randy Williams Synergy rwilliams@synergyonline.com
  • 2. About the Speaker US-West Coast Manager for Synergy Based in San Diego, California Consultant/Trainer/Author SharePoint MVP Specialty in architecting solutions Blog: www.synergyonline.com/randy Twitter: @tweetraw
  • 3. Agenda AJAX Custom Web Services Client Object Model jQuery
  • 4. How AJAX Works AJAX consists of JavaScript, DHTML and XMLHTTP XMLHTTPRequest object Acts as a web service client Used instead of a full postback Web server processes request and sends back response to browser Browser receives the response and updates the page dynamically
  • 5. Using AJAX in SP2010 No configuration changes needed Built into web.config Built into v4.master Two primary ways Using UpdatePanel control (basic) Calling web services (advanced)
  • 6. UpdatePanel Part of ASP.NET 3.5 Easiest way to add AJAX capability Most server-side events run as partial postbacks For SharePoint, use conditional mode up.UpdateMode= UpdatePanelUpdateMode.Conditional; Simple, but limited
  • 8. Calling Web Services Using AJAX, the browser can directly call into Web Services More powerful than UpdatePanel JSON is used to encode messages AJAX engine does most of the hard work Depending on the method used, OOB Web Services will not work Custom ones can be used
  • 9. Creating Custom Web Services Create new WCF Service App project Write web service Configure a web.config for web service Dynamic bindings will not work with AJAX enableWebScript endpoint behavior – allows it to be called from AJAX client Deploy within 14SAPI
  • 10. Demo Using AJAX to Call Custom Web Service
  • 11. Client Object Model Working with SharePoint from client applications ECMAScript (JavaScript) Silverlight .NET Managed Easier than calling web services directly Provides a subset of the functionality available in the server object model Designed to work with data within a site collection
  • 12. The ClientContext Object ClientContext is your handle to all other objects Site, Web, List, Item, File Optimizes communication to server by batching requests Typical usage: Define a query to retrieve or modify SharePoint objects Pass the query to one of the ClientContext’s Load methods Use ClientContext to execute the query Work with results returned
  • 13. Demo Client OM from Silverlight Web Part
  • 14. Session Heads-Up In Raphael 1, tomorrow at 1:45pm… Randy Williams SharePoint 2010: Developing with Data Technologies
  • 15. Using jQuery Multi-purpose JavaScript library With it, you will write less JavaScript  Cross-browser support Create interactive and usable apps No need to deploy assemblies Works great in sandboxed web parts Hundreds of jQuery plugins
  • 16. Where to Store these .js Libraries? Deploy as a module-type feature Works in both farm and sandboxed WSP Copy manually to designed libraries e.g. SiteAssets Shared or individual instances? Best to not rename file e.g. keep as jquery-1.5.1.js
  • 18. Using SPServices Two primary functions Allows jQuery to easily call SharePoint OOB web services ListFormWebPart enhancements Download from http://spservices.codeplex.com/ Use when Client OM is insufficient
  • 19. Demo Using jQuery and SPServices
  • 20. Your Feedback is Important Please fill out a session evaluation form. Thank you!