SlideShare a Scribd company logo
Sitecore MVC renderings
Converting Web Forms sublayouts
Prepared by: Jason St-Cyr and Nick Allen
November 2014
Converting Sitecore Web Forms to MVC
• Sublayouts to Controller Renderings
• The ViewModel
• The View
• Things to watch out for
Resources
Sublayouts to Controller Rendering
• Create Controller Rendering item (sitecoreLayoutRenderings)
- 1-to-1 Sublayout item to Controller Rendering item
- Many fields are the same (Cache settings, Display Name, Custom
Experience buttons)
- Not necessarily 1-to-1 for .cshtml
• Create Controller method
- Examine presentation logic of ASCX and ASCX.cs
- Determine ‘state’ toggles (Page Editor vs. Normal, Empty Collections,
No Datasource specified)
- Build business logic to load different views for each state
Toronto | Ottawa | New York | Calgary | São Paulo | Florianópolis 3
Sublayouts to Controller Rendering: Controller example
Toronto | Ottawa | New York | Calgary | São Paulo | Florianópolis 4
public ActionResult Accordion()
{
var model = DataSourceItem != null ? new AccordionViewModel(this.DataSourceItem) : null;
var viewResult = model != null ? this.View("Accordion/Accordion", model) : this.View("Accordion/Accordion");
if (Sitecore.Context.PageMode.IsPageEditor)
{
if (model == null)
{
viewResult = this.View("DatasourceMissing", new DatasourceMissingViewModel());
}
else if (!model.AccordionContainer.Panes.Any())
{
viewResult = this.View("Accordion/AccordionNoPanels", model);
}
else
{
viewResult = this.View("Accordion/AccordionPageEditor", model);
}
}
return viewResult;
}
Sublayouts to Controller Rendering: The ViewModel
Toronto | Ottawa | New York | Calgary | São Paulo | Florianópolis 5
• Create .cs file to represent the object model
• Should contain all the properties needed for rendering
• Should wrap around data object
• Constructor must take an Item (datasource)
• Migrate ASCX and ASCX.cs logic to ViewModel as needed
• e.g. Code for loading configurations, methods to determine Boolean
conditions, logic to determine ‘active’ classes
• Ensure Controller is instantiating ViewModel
Sublayouts to Controller Rendering: ViewModel Example
Toronto | Ottawa | New York | Calgary | São Paulo | Florianópolis 6
using System.Globalization;
using Keystone.SBL.Templates.Components;
using Sitecore.Data.Items;
namespace Keystone.MVC.ViewModels.Components
{
public class IFrameViewModel
{
public IFrame Frame { get; set; }
public string Height { get; set; }
public string FrameBorder { get; set; }
public IFrameViewModel(Item dataSource)
{
Frame = new IFrame(dataSource);
Height = !Frame.Height.HasValue ? "500" :
Frame.Height.Value.ToString(CultureInfo.InvariantCulture);
FrameBorder = Frame.ShowFrameBorder ? "1" : "0";
}
}
}
Sublayouts to Controller Rendering: The View
Toronto | Ottawa | New York | Calgary | São Paulo | Florianópolis 7
• Create .cshtml file in the “Views” folder
• WebsiteViews<path>
• May need multiple (e.g. Accordion shown earlier).
• Group multiple similar views in folders
• Build markup in View
• Use Sitecore HTML Helper methods for outputting fields
• Associate to ViewModel
• Minimize logic in the View, place in ViewModel class
Sublayouts to Controller Rendering: View Example
Toronto | Ottawa | New York | Calgary | São Paulo | Florianópolis 8
@using Keystone.SBL.Templates.Components
@using Sitecore.Mvc
@model Keystone.MVC.ViewModels.Components.PanelViewModel
<div class="panel @Model.StyleCode @Model.Panel.BaseComponent["Additional Styles"]">
<div class="panel-heading">
<h3 class="panel-title">@Html.Sitecore().Field(Panel.FieldIds.Title.ToString())</h3>
</div>
<div class="panel-body">
@Html.Sitecore().Field(Panel.FieldIds.Content.ToString())
</div>
</div>
Things to watch out for
• Placeholder settings
- Need to update to make an MVC component available.
- If building both Web Forms and MVC components in the same build, may have same name in placeholder settings.
- May need separate placeholder settings for MVC vs. Web Forms.
• Insert Options
- Need to have custom insert rules to specify which templates are available to author (MVC or Web Forms).
- This may be driven via path naming convention in the tree, or via a configuration-driven rule.
• Page Templates
- Different Page Templates are required in order to specify an MVC layout and default MVC components.
- Recommendation is to have ‘base’ templates which define all fields, then have presentation templates that specify
only the layout portion.
Toronto | Ottawa | New York | Calgary | São Paulo | Florianópolis 9
More things to watch out for
• Post-backs. As in: there are none.
- Use forms and actions to send data to the controller.
- Similar to building an HTTP POST integration
- No more server-control events, use Javascript events and AJAX
• Shared renderings
- If you use RenderPartial, needs to be in the Shared folder.
• Visual Studio syntax highlighting in Views
- Need reference to System.Web.MVC to get rid of the red
squigglies
Toronto | Ottawa | New York | Calgary | São Paulo | Florianópolis 10
Resources
Sitecore Community Docs
• http://sitecore-
community.github.io/docs/documentation/Sitecore%20MV
C/index.html
• Contains links to online content submitted by the Sitecore
community.
• Key links:
- Anything by Martina Welander
- Creating a Visual Studio Project for Sitecore MVC
- Sample Sitecore MVC project (used in Youtube tutorial videos)
Toronto | Ottawa | New York | Calgary | São Paulo | Florianópolis 12
MSDN and others
• ASP.NET MVC Overview:
- http://msdn.microsoft.com/en-
us/library/dd381412(v=vs.100).aspx
• Getting Started with ASP.NET MVC 5
- http://www.asp.net/mvc/overview/getting-
started/introduction/getting-started
• PluralSight ASP.NET MVC 5 Fundamentals
- http://www.pluralsight.com/courses/aspdotnet-mvc5-
fundamentals
Lessons Learned
Jason St-Cyr
 Solution Architect and Sitecore MVP, nonlinear digital
 Background in .NET software development and Application Lifecycle
Management
 Contact me: jst-cyr@nonlinear.ca
 Around the web:
 Technical Blog:
http://theagilecoder.wordpress.com
 LinkedIn Profile:
http://www.linkedin.com/pub/jason-st-cyr/26/a73/645
 Nonlinear Thinking:
http://www.nonlinearcreations.com/Digital/how-we-think
 Twitter: @AgileStCyr
Lessons Learned
Nick Allen
 Solution Architect and Sitecore MVP, nonlinear digital
 Background in .NET software development
 Contact me: nallen@nonlinear.ca
 Around the web:
 Technical Blog:
http://sitecorecreative.wordpress.com
 LinkedIn Profile:
https://www.linkedin.com/in/nickallen80
 Nonlinear Thinking:
http://www.nonlinearcreations.com/Digital/how-we-think
 Twitter: @sitecoretweet

More Related Content

What's hot (20)

PPTX
Introduction to ASP.Net MVC
Sagar Kamate
 
PPTX
Asp.net mvc 5 course module 1 overview
Sergey Seletsky
 
PPTX
Getting started with MVC 5 and Visual Studio 2013
Thomas Robbins
 
PPTX
Discuss About ASP.NET MVC 6 and ASP.NET MVC 5
Aaron Jacobson
 
PDF
AngularJS Basics
Nikita Shounewich
 
PPTX
ASP.NET MVC 5 - EF 6 - VS2015
Hossein Zahed
 
PDF
Kentico and MVC
Cheryl MacDonald
 
PPTX
Using MVC with Kentico 8
Thomas Robbins
 
PPTX
Angularjs Basics
Jayantha Sirisena
 
PPTX
MVC 6 Introduction
Sudhakar Sharma
 
PPT
MSDN - ASP.NET MVC
Maarten Balliauw
 
PPTX
Asp.net MVC training session
Hrichi Mohamed
 
KEY
Everything you need to know about HTML5 in 15 min
Edgar Parada
 
PPTX
ASP .NET MVC
eldorina
 
PPTX
ASP .NET MVC - best practices
Bohdan Pashkovskyi
 
PPT
Mvc architecture
Surbhi Panhalkar
 
PPSX
Asp.net mvc
Er. Kamal Bhusal
 
PPTX
Asp.net mvc presentation by Nitin Sawant
Nitin S
 
PPT
ASP .net MVC
Divya Sharma
 
PDF
MVC 1.0 als alternative Webtechnologie
OPEN KNOWLEDGE GmbH
 
Introduction to ASP.Net MVC
Sagar Kamate
 
Asp.net mvc 5 course module 1 overview
Sergey Seletsky
 
Getting started with MVC 5 and Visual Studio 2013
Thomas Robbins
 
Discuss About ASP.NET MVC 6 and ASP.NET MVC 5
Aaron Jacobson
 
AngularJS Basics
Nikita Shounewich
 
ASP.NET MVC 5 - EF 6 - VS2015
Hossein Zahed
 
Kentico and MVC
Cheryl MacDonald
 
Using MVC with Kentico 8
Thomas Robbins
 
Angularjs Basics
Jayantha Sirisena
 
MVC 6 Introduction
Sudhakar Sharma
 
MSDN - ASP.NET MVC
Maarten Balliauw
 
Asp.net MVC training session
Hrichi Mohamed
 
Everything you need to know about HTML5 in 15 min
Edgar Parada
 
ASP .NET MVC
eldorina
 
ASP .NET MVC - best practices
Bohdan Pashkovskyi
 
Mvc architecture
Surbhi Panhalkar
 
Asp.net mvc
Er. Kamal Bhusal
 
Asp.net mvc presentation by Nitin Sawant
Nitin S
 
ASP .net MVC
Divya Sharma
 
MVC 1.0 als alternative Webtechnologie
OPEN KNOWLEDGE GmbH
 

Viewers also liked (6)

PPTX
24 Sitecore Tips that Every Sitecore Architect Needs to Know
Ashish Bansal
 
PPTX
Understanding the Sitecore Architecture
Pieter Brinkman
 
PDF
Sitecore & Microsoft Breakfast: Driving Retail Transformation - Avanade
Sitecore
 
PDF
Sitecore & Microsoft Breakfast: Sitecore opening address
Sitecore
 
PPT
Non hodgkins lymphoma
Chandan N
 
PPTX
Non hodgkin lymphoma
tashagarwal
 
24 Sitecore Tips that Every Sitecore Architect Needs to Know
Ashish Bansal
 
Understanding the Sitecore Architecture
Pieter Brinkman
 
Sitecore & Microsoft Breakfast: Driving Retail Transformation - Avanade
Sitecore
 
Sitecore & Microsoft Breakfast: Sitecore opening address
Sitecore
 
Non hodgkins lymphoma
Chandan N
 
Non hodgkin lymphoma
tashagarwal
 
Ad

Similar to Sitecore MVC: Converting Web Forms sublayouts (20)

PPTX
Sitecore KT for Layout
Manish Puri
 
PDF
Murach : How to develop a single-page MVC web
MahmoudOHassouna
 
PPTX
ASp.net Mvc 5
ahmedxp kh
 
PDF
Asp 1-mvc introduction
Fajar Baskoro
 
PPTX
Model view controller (mvc)
M Ahsan Khan
 
PPTX
Simple mvc4 prepared by gigin krishnan
Gigin Krishnan
 
PPTX
MVC 4
Vasilios Kuznos
 
PPTX
Asp.net c# MVC-5 Training-Day-2 of Day-9
AHM Pervej Kabir
 
PPTX
"Umbraco MVC - a journey of discovery" - Lotte Pitcher
lottepitcher
 
PDF
.NET Core, ASP.NET Core Course, Session 11
Amin Mesbahi
 
PPTX
MVC & SQL_In_1_Hour
Dilip Patel
 
PPTX
ASP.NET MVC.
Ni
 
PPTX
SoCal Code Camp 2011 - ASP.NET MVC 4
Jon Galloway
 
PPTX
Hanselman lipton asp_connections_ams304_mvc
denemedeniz
 
PPTX
MVC Training Part 1
Lee Englestone
 
PPTX
Hands on with ASP.NET MVC
rahulsahay19
 
PPTX
MVC Training Part 2
Lee Englestone
 
PPTX
Asp.net With mvc handson
Prashant Kumar
 
PPTX
Introduction to ASP.NET MVC
Joe Wilson
 
PPTX
Asp.Net MVC 5 in Arabic
Haitham Shaddad
 
Sitecore KT for Layout
Manish Puri
 
Murach : How to develop a single-page MVC web
MahmoudOHassouna
 
ASp.net Mvc 5
ahmedxp kh
 
Asp 1-mvc introduction
Fajar Baskoro
 
Model view controller (mvc)
M Ahsan Khan
 
Simple mvc4 prepared by gigin krishnan
Gigin Krishnan
 
Asp.net c# MVC-5 Training-Day-2 of Day-9
AHM Pervej Kabir
 
"Umbraco MVC - a journey of discovery" - Lotte Pitcher
lottepitcher
 
.NET Core, ASP.NET Core Course, Session 11
Amin Mesbahi
 
MVC & SQL_In_1_Hour
Dilip Patel
 
ASP.NET MVC.
Ni
 
SoCal Code Camp 2011 - ASP.NET MVC 4
Jon Galloway
 
Hanselman lipton asp_connections_ams304_mvc
denemedeniz
 
MVC Training Part 1
Lee Englestone
 
Hands on with ASP.NET MVC
rahulsahay19
 
MVC Training Part 2
Lee Englestone
 
Asp.net With mvc handson
Prashant Kumar
 
Introduction to ASP.NET MVC
Joe Wilson
 
Asp.Net MVC 5 in Arabic
Haitham Shaddad
 
Ad

More from nonlinear creations (17)

PPTX
Sitecore User Group: Session State and Sitecore xDB
nonlinear creations
 
PPTX
Sitecore on Azure
nonlinear creations
 
PDF
Unofficial Sitecore Training - Data enrichment and personalization
nonlinear creations
 
PPTX
The SickKids Foundation on enabling a digital CXM 'hub' with Sitecore
nonlinear creations
 
PPTX
Intranet trends to watch
nonlinear creations
 
PPTX
Design Credibility: No one trusts an ugly website
nonlinear creations
 
PPT
National Wildlife Federation- OMS- Dreamcore 2011
nonlinear creations
 
PDF
Spiral into control with Knowledge Management
nonlinear creations
 
PPTX
Icebergs
nonlinear creations
 
PPTX
8 tips for successful change management
nonlinear creations
 
PPTX
Cms project-failing-the-software-or-the-partner
nonlinear creations
 
PPTX
Understanding cloud platform services
nonlinear creations
 
PPTX
ALM 101: An introduction to application lifecycle management
nonlinear creations
 
PDF
Understanding web engagement management (WEM) and your social media presence
nonlinear creations
 
PDF
Sitecore: Understanding your visitors and user personas
nonlinear creations
 
PDF
Social intranets: 10 ways to drive adoption
nonlinear creations
 
PDF
Sitecore 7: A developers quest to mastering unit testing
nonlinear creations
 
Sitecore User Group: Session State and Sitecore xDB
nonlinear creations
 
Sitecore on Azure
nonlinear creations
 
Unofficial Sitecore Training - Data enrichment and personalization
nonlinear creations
 
The SickKids Foundation on enabling a digital CXM 'hub' with Sitecore
nonlinear creations
 
Intranet trends to watch
nonlinear creations
 
Design Credibility: No one trusts an ugly website
nonlinear creations
 
National Wildlife Federation- OMS- Dreamcore 2011
nonlinear creations
 
Spiral into control with Knowledge Management
nonlinear creations
 
8 tips for successful change management
nonlinear creations
 
Cms project-failing-the-software-or-the-partner
nonlinear creations
 
Understanding cloud platform services
nonlinear creations
 
ALM 101: An introduction to application lifecycle management
nonlinear creations
 
Understanding web engagement management (WEM) and your social media presence
nonlinear creations
 
Sitecore: Understanding your visitors and user personas
nonlinear creations
 
Social intranets: 10 ways to drive adoption
nonlinear creations
 
Sitecore 7: A developers quest to mastering unit testing
nonlinear creations
 

Recently uploaded (20)

PDF
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
PPTX
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
PDF
What Makes Contify’s News API Stand Out: Key Features at a Glance
Contify
 
PDF
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
PPTX
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
PDF
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
PPTX
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
PPTX
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
PDF
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
PDF
Advancing WebDriver BiDi support in WebKit
Igalia
 
PDF
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
PDF
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
PDF
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
PDF
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
DOCX
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
PPTX
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
DOCX
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
PPTX
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
PDF
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
What Makes Contify’s News API Stand Out: Key Features at a Glance
Contify
 
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
Advancing WebDriver BiDi support in WebKit
Igalia
 
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 

Sitecore MVC: Converting Web Forms sublayouts

  • 1. Sitecore MVC renderings Converting Web Forms sublayouts Prepared by: Jason St-Cyr and Nick Allen November 2014
  • 2. Converting Sitecore Web Forms to MVC • Sublayouts to Controller Renderings • The ViewModel • The View • Things to watch out for Resources
  • 3. Sublayouts to Controller Rendering • Create Controller Rendering item (sitecoreLayoutRenderings) - 1-to-1 Sublayout item to Controller Rendering item - Many fields are the same (Cache settings, Display Name, Custom Experience buttons) - Not necessarily 1-to-1 for .cshtml • Create Controller method - Examine presentation logic of ASCX and ASCX.cs - Determine ‘state’ toggles (Page Editor vs. Normal, Empty Collections, No Datasource specified) - Build business logic to load different views for each state Toronto | Ottawa | New York | Calgary | São Paulo | Florianópolis 3
  • 4. Sublayouts to Controller Rendering: Controller example Toronto | Ottawa | New York | Calgary | São Paulo | Florianópolis 4 public ActionResult Accordion() { var model = DataSourceItem != null ? new AccordionViewModel(this.DataSourceItem) : null; var viewResult = model != null ? this.View("Accordion/Accordion", model) : this.View("Accordion/Accordion"); if (Sitecore.Context.PageMode.IsPageEditor) { if (model == null) { viewResult = this.View("DatasourceMissing", new DatasourceMissingViewModel()); } else if (!model.AccordionContainer.Panes.Any()) { viewResult = this.View("Accordion/AccordionNoPanels", model); } else { viewResult = this.View("Accordion/AccordionPageEditor", model); } } return viewResult; }
  • 5. Sublayouts to Controller Rendering: The ViewModel Toronto | Ottawa | New York | Calgary | São Paulo | Florianópolis 5 • Create .cs file to represent the object model • Should contain all the properties needed for rendering • Should wrap around data object • Constructor must take an Item (datasource) • Migrate ASCX and ASCX.cs logic to ViewModel as needed • e.g. Code for loading configurations, methods to determine Boolean conditions, logic to determine ‘active’ classes • Ensure Controller is instantiating ViewModel
  • 6. Sublayouts to Controller Rendering: ViewModel Example Toronto | Ottawa | New York | Calgary | São Paulo | Florianópolis 6 using System.Globalization; using Keystone.SBL.Templates.Components; using Sitecore.Data.Items; namespace Keystone.MVC.ViewModels.Components { public class IFrameViewModel { public IFrame Frame { get; set; } public string Height { get; set; } public string FrameBorder { get; set; } public IFrameViewModel(Item dataSource) { Frame = new IFrame(dataSource); Height = !Frame.Height.HasValue ? "500" : Frame.Height.Value.ToString(CultureInfo.InvariantCulture); FrameBorder = Frame.ShowFrameBorder ? "1" : "0"; } } }
  • 7. Sublayouts to Controller Rendering: The View Toronto | Ottawa | New York | Calgary | São Paulo | Florianópolis 7 • Create .cshtml file in the “Views” folder • WebsiteViews<path> • May need multiple (e.g. Accordion shown earlier). • Group multiple similar views in folders • Build markup in View • Use Sitecore HTML Helper methods for outputting fields • Associate to ViewModel • Minimize logic in the View, place in ViewModel class
  • 8. Sublayouts to Controller Rendering: View Example Toronto | Ottawa | New York | Calgary | São Paulo | Florianópolis 8 @using Keystone.SBL.Templates.Components @using Sitecore.Mvc @model Keystone.MVC.ViewModels.Components.PanelViewModel <div class="panel @Model.StyleCode @Model.Panel.BaseComponent["Additional Styles"]"> <div class="panel-heading"> <h3 class="panel-title">@Html.Sitecore().Field(Panel.FieldIds.Title.ToString())</h3> </div> <div class="panel-body"> @Html.Sitecore().Field(Panel.FieldIds.Content.ToString()) </div> </div>
  • 9. Things to watch out for • Placeholder settings - Need to update to make an MVC component available. - If building both Web Forms and MVC components in the same build, may have same name in placeholder settings. - May need separate placeholder settings for MVC vs. Web Forms. • Insert Options - Need to have custom insert rules to specify which templates are available to author (MVC or Web Forms). - This may be driven via path naming convention in the tree, or via a configuration-driven rule. • Page Templates - Different Page Templates are required in order to specify an MVC layout and default MVC components. - Recommendation is to have ‘base’ templates which define all fields, then have presentation templates that specify only the layout portion. Toronto | Ottawa | New York | Calgary | São Paulo | Florianópolis 9
  • 10. More things to watch out for • Post-backs. As in: there are none. - Use forms and actions to send data to the controller. - Similar to building an HTTP POST integration - No more server-control events, use Javascript events and AJAX • Shared renderings - If you use RenderPartial, needs to be in the Shared folder. • Visual Studio syntax highlighting in Views - Need reference to System.Web.MVC to get rid of the red squigglies Toronto | Ottawa | New York | Calgary | São Paulo | Florianópolis 10
  • 12. Sitecore Community Docs • http://sitecore- community.github.io/docs/documentation/Sitecore%20MV C/index.html • Contains links to online content submitted by the Sitecore community. • Key links: - Anything by Martina Welander - Creating a Visual Studio Project for Sitecore MVC - Sample Sitecore MVC project (used in Youtube tutorial videos) Toronto | Ottawa | New York | Calgary | São Paulo | Florianópolis 12
  • 13. MSDN and others • ASP.NET MVC Overview: - http://msdn.microsoft.com/en- us/library/dd381412(v=vs.100).aspx • Getting Started with ASP.NET MVC 5 - http://www.asp.net/mvc/overview/getting- started/introduction/getting-started • PluralSight ASP.NET MVC 5 Fundamentals - http://www.pluralsight.com/courses/aspdotnet-mvc5- fundamentals
  • 14. Lessons Learned Jason St-Cyr  Solution Architect and Sitecore MVP, nonlinear digital  Background in .NET software development and Application Lifecycle Management  Contact me: [email protected]  Around the web:  Technical Blog: http://theagilecoder.wordpress.com  LinkedIn Profile: http://www.linkedin.com/pub/jason-st-cyr/26/a73/645  Nonlinear Thinking: http://www.nonlinearcreations.com/Digital/how-we-think  Twitter: @AgileStCyr
  • 15. Lessons Learned Nick Allen  Solution Architect and Sitecore MVP, nonlinear digital  Background in .NET software development  Contact me: [email protected]  Around the web:  Technical Blog: http://sitecorecreative.wordpress.com  LinkedIn Profile: https://www.linkedin.com/in/nickallen80  Nonlinear Thinking: http://www.nonlinearcreations.com/Digital/how-we-think  Twitter: @sitecoretweet