SlideShare une entreprise Scribd logo
1  sur  29
Télécharger pour lire hors ligne
Ignite your ASP.NET MVC
Applications with Spark View
           Engine
         t: @curtis_mitchell
    e: curtismitchell@gmail.com
What is Spark View Engine?

A view engine for ASP.NET MVC and Castle MonoRail that gives
you the full capabilities of C# (and other languages) within
your views via an HTML-friendly syntax
Why Spark?
Spark turns this...
...into this!
Who is this presentation for?
Who is this presentation for?

Web Developers...

   ...that use MVC, but want to switch view engines
Who is this presentation for?

Web Developers...

   ...that use MVC, but want to switch view engines
   ...that know about Spark, but have been apprehensive
   about using it
Who is this presentation for?

Web Developers...

   ...that use MVC, but want to switch view engines
   ...that know about Spark, but have been apprehensive
   about using it
   ...that use other view engines like nHaml or nVelocity, but
   want to learn more about Spark
Who is this presentation for?

Web Developers...

   ...that use MVC, but want to switch view engines
   ...that know about Spark, but have been apprehensive
   about using it
   ...that use other view engines like nHaml or nVelocity, but
   want to learn more about Spark
   ...that just haven't had the time to sit down and learn
   Spark
...until now!
Agenda

1.   History of Spark
2.   Getting Started
3.   Concepts and Syntax
4.   More Concepts
5.   Gotchas
6.   References
7.   Wrap-up
Introducing Spark - History




  http://haacked.com/archive/2008/05/03/code-based-repeater-for-asp.net-mvc.
  aspx#67579
Getting Started With Spark
Getting Started

  Create/Open an MVC project
  Reference Spark.dll and Spark.Mvc.dll
  Configure the view engine
  Start using it!
Concepts and Syntax
Concepts and Syntax

Layouts
   LayoutsApplication.Spark
   SharedApplication.Spark
   View() method
   <use master="layout" /> 
 
 
 
 
 
 * The above methods are in order from weakest to the strongest.  In other words, <use
master="layout" /> takes precedence over having an Application.Spark file in the Layouts
folder.
Concepts and Syntax

Named Content
   <use content="" /> (in layout)
  <content name=""></content>, <content:name></content:
  name> (in view)
Concepts and Syntax

Partials
   <use file="" />
   <Partial someVar="" />
Concepts and Syntax

 Variables
    <var [var name]="[value]" type="[type]" /> or def
    <global [var name]="[value]" type="[type]" />
    <set [var name]="[value]" />
 ViewData 
    <viewdata key="type" />
Concepts and Syntax

_global.Spark
   Special partial that gets auto-included in a Spark file if it
   is in the layout folder or the root folder of the view
   Great place to put <using> statements, global variables, or
   other elements that do not immediately write to the
   output buffer
Concepts and Syntax

Control-of-flow statements
   <test> statement, <if><else>
   <for>
   Attributes on html elements
More Concepts
More Concepts

Inline C#
    Use # to delimit any plain ol' C# code
More Concepts

Macros
      Methods that can return strings for output
 
 
 
                                           . . .
(Not on the agenda)

These items are beyond this introductory presentation, but
Spark supports them:
   Caching of views (partial caching included)
   Pre-compilation of view classes (testing, performance)
   Descriptor Filters for differentiating views based on things
   like area, theme, or culture
Gotchas

1. Intellisense not working for some types like Html (helpers)
       The background compiler for Spark isn't finding the
       assemblies
       Copy the assemblies local to resolve
2. R#'s intellisense doesn't work with Spark.  
       If using R# and Spark, change R#'s intellisense setting to
       use Visual Studio's
       Don't use the <namespaces> section in the web.config
       file.  Use the <using> syntax in the _global.Spark file
       instead.
References and Links

1.   http://www.sparkviewengine.com
2.   http://www.whereslou.com
3.   http://www.github.com/loudej/spark
4.   http://www.dimecasts.net
Holla@me

    Thank you for your time and attention!
 
 
            Curtis Mitchell
            t: @curtis_mitchell
            e: curtismitchell@gmail.com
            b: http://www.curtismitchell.com
             
            http://speakerrate.com/talks/1524


 

Contenu connexe

Similaire à Spark View Engine (Richmond)

Aspect-oriented programming in Perl
Aspect-oriented programming in PerlAspect-oriented programming in Perl
Aspect-oriented programming in Perlmegakott
 
Lightning web components
Lightning web components Lightning web components
Lightning web components Cloud Analogy
 
Kubernetes and Local Dvelopment
Kubernetes and Local DvelopmentKubernetes and Local Dvelopment
Kubernetes and Local DvelopmentJeffrey Sica
 
.NET Core, ASP.NET Core Course, Session 18
 .NET Core, ASP.NET Core Course, Session 18 .NET Core, ASP.NET Core Course, Session 18
.NET Core, ASP.NET Core Course, Session 18aminmesbahi
 
Introduction to Apache Spark Developer Training
Introduction to Apache Spark Developer TrainingIntroduction to Apache Spark Developer Training
Introduction to Apache Spark Developer TrainingCloudera, Inc.
 
Learning spark ch07 - Running on a Cluster
Learning spark ch07 - Running on a ClusterLearning spark ch07 - Running on a Cluster
Learning spark ch07 - Running on a Clusterphanleson
 
Apexand visualforcearchitecture
Apexand visualforcearchitectureApexand visualforcearchitecture
Apexand visualforcearchitectureCMR WORLD TECH
 
Rg apexand visualforcearchitecture
Rg apexand visualforcearchitectureRg apexand visualforcearchitecture
Rg apexand visualforcearchitectureCMR WORLD TECH
 
Bhadale Group of Companies - digital projects
Bhadale Group of Companies - digital projectsBhadale Group of Companies - digital projects
Bhadale Group of Companies - digital projectsVijayananda Mohire
 
Lessons Learned: Scala and its Ecosystem
Lessons Learned: Scala and its EcosystemLessons Learned: Scala and its Ecosystem
Lessons Learned: Scala and its EcosystemPetr Hošek
 
DiUS Computing Lca Rails Final
DiUS  Computing Lca Rails FinalDiUS  Computing Lca Rails Final
DiUS Computing Lca Rails FinalRobert Postill
 
Content Management That Won't Rot Your Brain
Content Management That Won't Rot Your BrainContent Management That Won't Rot Your Brain
Content Management That Won't Rot Your BrainSean Cribbs
 
Introduction to Spark ML
Introduction to Spark MLIntroduction to Spark ML
Introduction to Spark MLHolden Karau
 
Ruby On Rails Tutorial
Ruby On Rails TutorialRuby On Rails Tutorial
Ruby On Rails Tutorialsunniboy
 
React & Redux JS
React & Redux JS React & Redux JS
React & Redux JS Hamed Farag
 
Monitor Apache Spark 3 on Kubernetes using Metrics and Plugins
Monitor Apache Spark 3 on Kubernetes using Metrics and PluginsMonitor Apache Spark 3 on Kubernetes using Metrics and Plugins
Monitor Apache Spark 3 on Kubernetes using Metrics and PluginsDatabricks
 
Developing a Struts & Tiles application using WebSphere Studio
Developing a Struts & Tiles application using WebSphere StudioDeveloping a Struts & Tiles application using WebSphere Studio
Developing a Struts & Tiles application using WebSphere Studioelliando dias
 

Similaire à Spark View Engine (Richmond) (20)

Aspect-oriented programming in Perl
Aspect-oriented programming in PerlAspect-oriented programming in Perl
Aspect-oriented programming in Perl
 
Lightning web components
Lightning web components Lightning web components
Lightning web components
 
Kubernetes and Local Dvelopment
Kubernetes and Local DvelopmentKubernetes and Local Dvelopment
Kubernetes and Local Dvelopment
 
.NET Core, ASP.NET Core Course, Session 18
 .NET Core, ASP.NET Core Course, Session 18 .NET Core, ASP.NET Core Course, Session 18
.NET Core, ASP.NET Core Course, Session 18
 
Spark tutorial
Spark tutorialSpark tutorial
Spark tutorial
 
Introduction to Apache Spark Developer Training
Introduction to Apache Spark Developer TrainingIntroduction to Apache Spark Developer Training
Introduction to Apache Spark Developer Training
 
Learning spark ch07 - Running on a Cluster
Learning spark ch07 - Running on a ClusterLearning spark ch07 - Running on a Cluster
Learning spark ch07 - Running on a Cluster
 
Apexand visualforcearchitecture
Apexand visualforcearchitectureApexand visualforcearchitecture
Apexand visualforcearchitecture
 
Rg apexand visualforcearchitecture
Rg apexand visualforcearchitectureRg apexand visualforcearchitecture
Rg apexand visualforcearchitecture
 
Bhadale Group of Companies - digital projects
Bhadale Group of Companies - digital projectsBhadale Group of Companies - digital projects
Bhadale Group of Companies - digital projects
 
Lessons Learned: Scala and its Ecosystem
Lessons Learned: Scala and its EcosystemLessons Learned: Scala and its Ecosystem
Lessons Learned: Scala and its Ecosystem
 
DiUS Computing Lca Rails Final
DiUS  Computing Lca Rails FinalDiUS  Computing Lca Rails Final
DiUS Computing Lca Rails Final
 
Content Management That Won't Rot Your Brain
Content Management That Won't Rot Your BrainContent Management That Won't Rot Your Brain
Content Management That Won't Rot Your Brain
 
Introduction to Spark ML
Introduction to Spark MLIntroduction to Spark ML
Introduction to Spark ML
 
Ibm
IbmIbm
Ibm
 
Mvc
MvcMvc
Mvc
 
Ruby On Rails Tutorial
Ruby On Rails TutorialRuby On Rails Tutorial
Ruby On Rails Tutorial
 
React & Redux JS
React & Redux JS React & Redux JS
React & Redux JS
 
Monitor Apache Spark 3 on Kubernetes using Metrics and Plugins
Monitor Apache Spark 3 on Kubernetes using Metrics and PluginsMonitor Apache Spark 3 on Kubernetes using Metrics and Plugins
Monitor Apache Spark 3 on Kubernetes using Metrics and Plugins
 
Developing a Struts & Tiles application using WebSphere Studio
Developing a Struts & Tiles application using WebSphere StudioDeveloping a Struts & Tiles application using WebSphere Studio
Developing a Struts & Tiles application using WebSphere Studio
 

Dernier

Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
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 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
 
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
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
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
 
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
 
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
 
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
 
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 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
 
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
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
#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
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
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.pptxHampshireHUG
 

Dernier (20)

Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
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 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
 
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
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
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
 
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
 
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
 
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
 
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
 
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...
 
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
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
#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
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
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
 

Spark View Engine (Richmond)

  • 1. Ignite your ASP.NET MVC Applications with Spark View Engine t: @curtis_mitchell e: curtismitchell@gmail.com
  • 2. What is Spark View Engine? A view engine for ASP.NET MVC and Castle MonoRail that gives you the full capabilities of C# (and other languages) within your views via an HTML-friendly syntax
  • 6. Who is this presentation for?
  • 7. Who is this presentation for? Web Developers... ...that use MVC, but want to switch view engines
  • 8. Who is this presentation for? Web Developers... ...that use MVC, but want to switch view engines ...that know about Spark, but have been apprehensive about using it
  • 9. Who is this presentation for? Web Developers... ...that use MVC, but want to switch view engines ...that know about Spark, but have been apprehensive about using it ...that use other view engines like nHaml or nVelocity, but want to learn more about Spark
  • 10. Who is this presentation for? Web Developers... ...that use MVC, but want to switch view engines ...that know about Spark, but have been apprehensive about using it ...that use other view engines like nHaml or nVelocity, but want to learn more about Spark ...that just haven't had the time to sit down and learn Spark
  • 12. Agenda 1. History of Spark 2. Getting Started 3. Concepts and Syntax 4. More Concepts 5. Gotchas 6. References 7. Wrap-up
  • 13. Introducing Spark - History http://haacked.com/archive/2008/05/03/code-based-repeater-for-asp.net-mvc. aspx#67579
  • 15. Getting Started Create/Open an MVC project Reference Spark.dll and Spark.Mvc.dll Configure the view engine Start using it!
  • 17. Concepts and Syntax Layouts LayoutsApplication.Spark SharedApplication.Spark View() method <use master="layout" />             * The above methods are in order from weakest to the strongest.  In other words, <use master="layout" /> takes precedence over having an Application.Spark file in the Layouts folder.
  • 18. Concepts and Syntax Named Content  <use content="" /> (in layout) <content name=""></content>, <content:name></content: name> (in view)
  • 19. Concepts and Syntax Partials <use file="" /> <Partial someVar="" />
  • 20. Concepts and Syntax Variables <var [var name]="[value]" type="[type]" /> or def <global [var name]="[value]" type="[type]" /> <set [var name]="[value]" /> ViewData  <viewdata key="type" />
  • 21. Concepts and Syntax _global.Spark Special partial that gets auto-included in a Spark file if it is in the layout folder or the root folder of the view Great place to put <using> statements, global variables, or other elements that do not immediately write to the output buffer
  • 22. Concepts and Syntax Control-of-flow statements <test> statement, <if><else> <for> Attributes on html elements
  • 24. More Concepts Inline C# Use # to delimit any plain ol' C# code
  • 25. More Concepts Macros  Methods that can return strings for output                                                  . . .
  • 26. (Not on the agenda) These items are beyond this introductory presentation, but Spark supports them: Caching of views (partial caching included) Pre-compilation of view classes (testing, performance) Descriptor Filters for differentiating views based on things like area, theme, or culture
  • 27. Gotchas 1. Intellisense not working for some types like Html (helpers) The background compiler for Spark isn't finding the assemblies Copy the assemblies local to resolve 2. R#'s intellisense doesn't work with Spark.   If using R# and Spark, change R#'s intellisense setting to use Visual Studio's Don't use the <namespaces> section in the web.config file.  Use the <using> syntax in the _global.Spark file instead.
  • 28. References and Links 1. http://www.sparkviewengine.com 2. http://www.whereslou.com 3. http://www.github.com/loudej/spark 4. http://www.dimecasts.net
  • 29. Holla@me Thank you for your time and attention!     Curtis Mitchell t: @curtis_mitchell e: curtismitchell@gmail.com b: http://www.curtismitchell.com   http://speakerrate.com/talks/1524