SlideShare uma empresa Scribd logo
1 de 11
Parth Pandya
parth@varahitechnologies.com
 Application contained in only page and all
other resource are dynamically loaded in
single page container
 Some of benefits of it is
◦ You can easily make them compatible with different
devices (Such as mobile and web browsers)
◦ Being single page application it has reach user
experience and less round tripping to server
 Set of library as part of the visual studio
template that can be used to SPA
 It contains
◦ Durandal(For navigation)
◦ Knockout(For binding)
◦ Breeze(For client side data access)
◦ Toastr (For messages)
◦ Twitter bootstrap(For mobile compatibility and CSS
styling)
 Download WebTools 2012.2 update
http://weblogs.asp.net/scottgu/archive/2013/0
2/18/announcing-release-of-asp-net-and-web-
tools-2012-2-update.aspx or Install nuget
package for HotTowel
 Follow jonh papa’s blog at
http://www.johnpapa.net/hottowel/ or go
through
http://pluralsight.com/training/courses/TableOf
Contents?courseName=single-page-apps-
jumpstart and download complete plurasight
code from
https://github.com/johnpapa/PluralsightSpaJum
pStartFinal
•In HotTowel one can see App folder which
contains overall structure of the application and the
way it is going to behave
• Durandal folder contains navigation logic for
viewmodel , view and provide proper mapping
between different folder part of the project
• Shell.js contains navigation details and project
startup events. We can use activate or boot events
in order to register startup parameters for the in
our SPA or add new pages navigation inside boot
function.
• Services folder contains various services that we
are planning to use throughout our application
such as logger.js is already there for showing
toaster message. Similarly, we can create services
that will talk to our controller for retrieving data
•Viewmodels foder will contain JavaScript files
where will put logic to bind ui and call services to
save data
•Views folder will contain html files where we will
be putting UI markups
 Add new link in navigation (shell.js)
router.mapNav('employee');
 Add employee.js and employee.html
viewmodels and view respectively
 Modify content on employee.html and run
the application in order to see that the
content are reflected properly
 Create a model named Employee with Id and
Name property
 Run Enalbe-Migration command (Enable-
Migrations -ContextTypeName
HotTowelExample1.Models.EmployeeDBConte
xt)
 Execute add-migration Initial for creating
scripts for database tables
 Seed data in Configuration class
 Run update-database to populate data with
dummy records
 Create a Controller in Controller folder and
inherit it from ApiController and provide
[BreezeController] attribute for class
 Implement readonly property for
ContextAccess and Metadata() method for
consuming it with Breeze
 Implement GetEmployees method to return all
employees from BreezeController which will
be consumed by our client side application
 In App/Services crate model.js and
datacontext.js files
 In datacontex.js implement a function to
retreive data
 Take object of breeze.EntityQuery for
querying breeze controller and configure
manager by calling registerEntityTypeCtor on
each entity to be used in javascript
 This part is written in model.js file
 Create function getEmpoyees to retreive and
set observable collecton to be used by UI
 In ViewModel(employee.js) create file to
return observable to be used in view. Include
observable as part of return vm as to be
consumable with view
 Observable array will be passed to data
context for loading data and will be set with
employeeObservable(data.results)
 Use knockout binding to on UI
 Tip:() use to evaluate knockout properties
 Example for the slide can be found at
http://dms.varahitest.in/Example/HotTowelE
xample1.zip

Mais conteúdo relacionado

Mais procurados

Building Offline Ready and Installable Web App
Building Offline Ready and Installable Web AppBuilding Offline Ready and Installable Web App
Building Offline Ready and Installable Web AppMuhammad Samu
 
Page life cycle
Page life cyclePage life cycle
Page life cycleanil4691
 
Ise312 Ec Presentation Jquery
Ise312 Ec Presentation JqueryIse312 Ec Presentation Jquery
Ise312 Ec Presentation Jqueryduygut
 
Labs And Walkthroughs
Labs And WalkthroughsLabs And Walkthroughs
Labs And WalkthroughsBryan Tuttle
 
Developing eXtensions for HUE
Developing eXtensions for HUEDeveloping eXtensions for HUE
Developing eXtensions for HUEMaksym Doroshenko
 
jQuery programming with visual web part
jQuery programming with visual web partjQuery programming with visual web part
jQuery programming with visual web partSenthamil Selvan
 
Introduction to AngularJS Framework
Introduction to AngularJS FrameworkIntroduction to AngularJS Framework
Introduction to AngularJS FrameworkRaveendra R
 
Converting Your Mobile App to the Mobile Cloud
Converting Your Mobile App to the Mobile CloudConverting Your Mobile App to the Mobile Cloud
Converting Your Mobile App to the Mobile CloudRoger Brinkley
 
Creating EPiServer Usage Reports
Creating EPiServer Usage ReportsCreating EPiServer Usage Reports
Creating EPiServer Usage ReportsPaul Graham
 
Eventbus Library and How Does it Work?
Eventbus Library and How Does it Work?Eventbus Library and How Does it Work?
Eventbus Library and How Does it Work?InnovationM
 

Mais procurados (13)

title
titletitle
title
 
reactJS
reactJSreactJS
reactJS
 
Building Offline Ready and Installable Web App
Building Offline Ready and Installable Web AppBuilding Offline Ready and Installable Web App
Building Offline Ready and Installable Web App
 
Page life cycle
Page life cyclePage life cycle
Page life cycle
 
Ise312 Ec Presentation Jquery
Ise312 Ec Presentation JqueryIse312 Ec Presentation Jquery
Ise312 Ec Presentation Jquery
 
Labs And Walkthroughs
Labs And WalkthroughsLabs And Walkthroughs
Labs And Walkthroughs
 
Developing eXtensions for HUE
Developing eXtensions for HUEDeveloping eXtensions for HUE
Developing eXtensions for HUE
 
jQuery programming with visual web part
jQuery programming with visual web partjQuery programming with visual web part
jQuery programming with visual web part
 
Introduction to AngularJS Framework
Introduction to AngularJS FrameworkIntroduction to AngularJS Framework
Introduction to AngularJS Framework
 
Converting Your Mobile App to the Mobile Cloud
Converting Your Mobile App to the Mobile CloudConverting Your Mobile App to the Mobile Cloud
Converting Your Mobile App to the Mobile Cloud
 
Web component
Web componentWeb component
Web component
 
Creating EPiServer Usage Reports
Creating EPiServer Usage ReportsCreating EPiServer Usage Reports
Creating EPiServer Usage Reports
 
Eventbus Library and How Does it Work?
Eventbus Library and How Does it Work?Eventbus Library and How Does it Work?
Eventbus Library and How Does it Work?
 

Destaque

Presentación de Adrima
Presentación de AdrimaPresentación de Adrima
Presentación de Adrimatolano
 
Materi sistem pernafasan manusia
Materi sistem pernafasan manusiaMateri sistem pernafasan manusia
Materi sistem pernafasan manusiaSharah Sharah
 
Powering front end apps with NServiceBus
Powering front end apps with NServiceBusPowering front end apps with NServiceBus
Powering front end apps with NServiceBusBritt King
 
Testamentode Cristo
Testamentode CristoTestamentode Cristo
Testamentode Cristoguest12766c
 
Florencia Nieves
Florencia NievesFlorencia Nieves
Florencia Nievesguest12766c
 
App modernization and evented architectures with Node.js
App modernization and evented architectures with Node.jsApp modernization and evented architectures with Node.js
App modernization and evented architectures with Node.jsScott Persinger
 
Making workflow implementation easy with CQRS
Making workflow implementation easy with CQRSMaking workflow implementation easy with CQRS
Making workflow implementation easy with CQRSParticular Software
 
ReactJS.NET - Fast and Scalable Single Page Applications
ReactJS.NET - Fast and Scalable Single Page ApplicationsReactJS.NET - Fast and Scalable Single Page Applications
ReactJS.NET - Fast and Scalable Single Page ApplicationsRick Beerendonk
 
“творчий педагог – творчі діти”
“творчий  педагог – творчі діти”“творчий  педагог – творчі діти”
“творчий педагог – творчі діти”jekah
 
Dium Corp A08cas
Dium Corp A08casDium Corp A08cas
Dium Corp A08casguest12766c
 
Дайджест новостей и трендов в e-commerce за 25.04 – 21.05.2015
Дайджест новостей и трендов в e-commerce за 25.04 – 21.05.2015Дайджест новостей и трендов в e-commerce за 25.04 – 21.05.2015
Дайджест новостей и трендов в e-commerce за 25.04 – 21.05.2015E-commerce Solutions
 
Hiroshima And Nagasaki
Hiroshima And NagasakiHiroshima And Nagasaki
Hiroshima And Nagasakiguest12766c
 

Destaque (19)

Presentación de Adrima
Presentación de AdrimaPresentación de Adrima
Presentación de Adrima
 
Materi sistem pernafasan manusia
Materi sistem pernafasan manusiaMateri sistem pernafasan manusia
Materi sistem pernafasan manusia
 
Powering front end apps with NServiceBus
Powering front end apps with NServiceBusPowering front end apps with NServiceBus
Powering front end apps with NServiceBus
 
Testamentode Cristo
Testamentode CristoTestamentode Cristo
Testamentode Cristo
 
Las 5 Mejores Playas De Málaga
Las 5 Mejores Playas De MálagaLas 5 Mejores Playas De Málaga
Las 5 Mejores Playas De Málaga
 
Florencia Nieves
Florencia NievesFlorencia Nieves
Florencia Nieves
 
App modernization and evented architectures with Node.js
App modernization and evented architectures with Node.jsApp modernization and evented architectures with Node.js
App modernization and evented architectures with Node.js
 
Making workflow implementation easy with CQRS
Making workflow implementation easy with CQRSMaking workflow implementation easy with CQRS
Making workflow implementation easy with CQRS
 
ReactJS.NET - Fast and Scalable Single Page Applications
ReactJS.NET - Fast and Scalable Single Page ApplicationsReactJS.NET - Fast and Scalable Single Page Applications
ReactJS.NET - Fast and Scalable Single Page Applications
 
Perpres 71 2013_new
Perpres 71 2013_newPerpres 71 2013_new
Perpres 71 2013_new
 
JesúS, Amigo
JesúS, AmigoJesúS, Amigo
JesúS, Amigo
 
“творчий педагог – творчі діти”
“творчий  педагог – творчі діти”“творчий  педагог – творчі діти”
“творчий педагог – творчі діти”
 
Dium Corp A08cas
Dium Corp A08casDium Corp A08cas
Dium Corp A08cas
 
Labuan cermin
Labuan cerminLabuan cermin
Labuan cermin
 
Perlas 1
Perlas 1Perlas 1
Perlas 1
 
Дайджест новостей и трендов в e-commerce за 25.04 – 21.05.2015
Дайджест новостей и трендов в e-commerce за 25.04 – 21.05.2015Дайджест новостей и трендов в e-commerce за 25.04 – 21.05.2015
Дайджест новостей и трендов в e-commerce за 25.04 – 21.05.2015
 
Hiroshima And Nagasaki
Hiroshima And NagasakiHiroshima And Nagasaki
Hiroshima And Nagasaki
 
Iguazu
IguazuIguazu
Iguazu
 
Mutantes
MutantesMutantes
Mutantes
 

Semelhante a How to build a Single Page Application (SPA) using HotTowel template in ASP.NET

Meteor Meet-up San Diego December 2014
Meteor Meet-up San Diego December 2014Meteor Meet-up San Diego December 2014
Meteor Meet-up San Diego December 2014Lou Sacco
 
Having Fun Building Web Applications (Day 2 slides)
Having Fun Building Web Applications (Day 2 slides)Having Fun Building Web Applications (Day 2 slides)
Having Fun Building Web Applications (Day 2 slides)Clarence Ngoh
 
Introduction To Umbraco
Introduction To UmbracoIntroduction To Umbraco
Introduction To UmbracoKen Cenerelli
 
ChircuVictor StefircaMadalin rad_aspmvc3_wcf_vs2010
ChircuVictor StefircaMadalin rad_aspmvc3_wcf_vs2010ChircuVictor StefircaMadalin rad_aspmvc3_wcf_vs2010
ChircuVictor StefircaMadalin rad_aspmvc3_wcf_vs2010vchircu
 
Java Web Programming on Google Cloud Platform [1/3] : Google App Engine
Java Web Programming on Google Cloud Platform [1/3] : Google App EngineJava Web Programming on Google Cloud Platform [1/3] : Google App Engine
Java Web Programming on Google Cloud Platform [1/3] : Google App EngineIMC Institute
 
WinRT and the Web: Keeping Windows Store Apps Alive and Connected
WinRT and the Web: Keeping Windows Store Apps Alive and ConnectedWinRT and the Web: Keeping Windows Store Apps Alive and Connected
WinRT and the Web: Keeping Windows Store Apps Alive and ConnectedJeremy Likness
 
Tips and tricks for building Large web applications with Drupal
Tips and tricks for building Large web applications with DrupalTips and tricks for building Large web applications with Drupal
Tips and tricks for building Large web applications with DrupalMitzaCeusan
 
UMD User's Group: DrupalCon 2011, Chicago
UMD User's Group: DrupalCon 2011, ChicagoUMD User's Group: DrupalCon 2011, Chicago
UMD User's Group: DrupalCon 2011, Chicagobrockfanning
 
Adding a view
Adding a viewAdding a view
Adding a viewNhan Do
 
How to Webpack your Django!
How to Webpack your Django!How to Webpack your Django!
How to Webpack your Django!David Gibbons
 
Server side programming bt0083
Server side programming bt0083Server side programming bt0083
Server side programming bt0083Divyam Pateriya
 

Semelhante a How to build a Single Page Application (SPA) using HotTowel template in ASP.NET (20)

ASP.NET Identity
ASP.NET IdentityASP.NET Identity
ASP.NET Identity
 
Meteor Meet-up San Diego December 2014
Meteor Meet-up San Diego December 2014Meteor Meet-up San Diego December 2014
Meteor Meet-up San Diego December 2014
 
Having Fun Building Web Applications (Day 2 slides)
Having Fun Building Web Applications (Day 2 slides)Having Fun Building Web Applications (Day 2 slides)
Having Fun Building Web Applications (Day 2 slides)
 
ASP.NET MVC3 RAD
ASP.NET MVC3 RADASP.NET MVC3 RAD
ASP.NET MVC3 RAD
 
Introduction To Umbraco
Introduction To UmbracoIntroduction To Umbraco
Introduction To Umbraco
 
ChircuVictor StefircaMadalin rad_aspmvc3_wcf_vs2010
ChircuVictor StefircaMadalin rad_aspmvc3_wcf_vs2010ChircuVictor StefircaMadalin rad_aspmvc3_wcf_vs2010
ChircuVictor StefircaMadalin rad_aspmvc3_wcf_vs2010
 
Test
TestTest
Test
 
Java Web Programming on Google Cloud Platform [1/3] : Google App Engine
Java Web Programming on Google Cloud Platform [1/3] : Google App EngineJava Web Programming on Google Cloud Platform [1/3] : Google App Engine
Java Web Programming on Google Cloud Platform [1/3] : Google App Engine
 
Moving to Drupal
Moving to DrupalMoving to Drupal
Moving to Drupal
 
code-camp-meteor
code-camp-meteorcode-camp-meteor
code-camp-meteor
 
Synopsis
SynopsisSynopsis
Synopsis
 
WinRT and the Web: Keeping Windows Store Apps Alive and Connected
WinRT and the Web: Keeping Windows Store Apps Alive and ConnectedWinRT and the Web: Keeping Windows Store Apps Alive and Connected
WinRT and the Web: Keeping Windows Store Apps Alive and Connected
 
Tips and tricks for building Large web applications with Drupal
Tips and tricks for building Large web applications with DrupalTips and tricks for building Large web applications with Drupal
Tips and tricks for building Large web applications with Drupal
 
UMD User's Group: DrupalCon 2011, Chicago
UMD User's Group: DrupalCon 2011, ChicagoUMD User's Group: DrupalCon 2011, Chicago
UMD User's Group: DrupalCon 2011, Chicago
 
Adding a view
Adding a viewAdding a view
Adding a view
 
Google App Engine
Google App EngineGoogle App Engine
Google App Engine
 
How to Webpack your Django!
How to Webpack your Django!How to Webpack your Django!
How to Webpack your Django!
 
Server side programming bt0083
Server side programming bt0083Server side programming bt0083
Server side programming bt0083
 
sveltekit-en.pdf
sveltekit-en.pdfsveltekit-en.pdf
sveltekit-en.pdf
 
Html5
Html5Html5
Html5
 

Último

#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
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 organizationRadu Cotescu
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
[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.pdfhans926745
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
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 MenDelhi Call girls
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
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 Nanonetsnaman860154
 

Último (20)

#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
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
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
[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 Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
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
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
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
 

How to build a Single Page Application (SPA) using HotTowel template in ASP.NET

  • 2.  Application contained in only page and all other resource are dynamically loaded in single page container  Some of benefits of it is ◦ You can easily make them compatible with different devices (Such as mobile and web browsers) ◦ Being single page application it has reach user experience and less round tripping to server
  • 3.  Set of library as part of the visual studio template that can be used to SPA  It contains ◦ Durandal(For navigation) ◦ Knockout(For binding) ◦ Breeze(For client side data access) ◦ Toastr (For messages) ◦ Twitter bootstrap(For mobile compatibility and CSS styling)
  • 4.  Download WebTools 2012.2 update http://weblogs.asp.net/scottgu/archive/2013/0 2/18/announcing-release-of-asp-net-and-web- tools-2012-2-update.aspx or Install nuget package for HotTowel  Follow jonh papa’s blog at http://www.johnpapa.net/hottowel/ or go through http://pluralsight.com/training/courses/TableOf Contents?courseName=single-page-apps- jumpstart and download complete plurasight code from https://github.com/johnpapa/PluralsightSpaJum pStartFinal
  • 5. •In HotTowel one can see App folder which contains overall structure of the application and the way it is going to behave • Durandal folder contains navigation logic for viewmodel , view and provide proper mapping between different folder part of the project • Shell.js contains navigation details and project startup events. We can use activate or boot events in order to register startup parameters for the in our SPA or add new pages navigation inside boot function. • Services folder contains various services that we are planning to use throughout our application such as logger.js is already there for showing toaster message. Similarly, we can create services that will talk to our controller for retrieving data •Viewmodels foder will contain JavaScript files where will put logic to bind ui and call services to save data •Views folder will contain html files where we will be putting UI markups
  • 6.  Add new link in navigation (shell.js) router.mapNav('employee');  Add employee.js and employee.html viewmodels and view respectively  Modify content on employee.html and run the application in order to see that the content are reflected properly
  • 7.  Create a model named Employee with Id and Name property  Run Enalbe-Migration command (Enable- Migrations -ContextTypeName HotTowelExample1.Models.EmployeeDBConte xt)  Execute add-migration Initial for creating scripts for database tables  Seed data in Configuration class  Run update-database to populate data with dummy records
  • 8.  Create a Controller in Controller folder and inherit it from ApiController and provide [BreezeController] attribute for class  Implement readonly property for ContextAccess and Metadata() method for consuming it with Breeze  Implement GetEmployees method to return all employees from BreezeController which will be consumed by our client side application
  • 9.  In App/Services crate model.js and datacontext.js files  In datacontex.js implement a function to retreive data  Take object of breeze.EntityQuery for querying breeze controller and configure manager by calling registerEntityTypeCtor on each entity to be used in javascript  This part is written in model.js file  Create function getEmpoyees to retreive and set observable collecton to be used by UI
  • 10.  In ViewModel(employee.js) create file to return observable to be used in view. Include observable as part of return vm as to be consumable with view  Observable array will be passed to data context for loading data and will be set with employeeObservable(data.results)  Use knockout binding to on UI  Tip:() use to evaluate knockout properties
  • 11.  Example for the slide can be found at http://dms.varahitest.in/Example/HotTowelE xample1.zip