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
ZZ BC#7 asp.net mvc practice and guideline by NineMvp
Chalermpon Areepong
 
PDF
Aspnetmvc 1
Fajar Baskoro
 
PPTX
SoCal Code Camp 2011 - ASP.NET 4.5
Jon Galloway
 
PPTX
ASP.NET - Building Web Application..in the right way!
Fioriela Bego
 
PPTX
ASP.NET - Building Web Application..in the right way!
Commit Software Sh.p.k.
 
PPTX
Building Modern Websites with ASP.NET by Rachel Appel
.NET Conf UY
 
PPTX
Introduction to ASP.NET MVC
Joe Wilson
 
PPTX
Asp.net With mvc handson
Prashant Kumar
 
PPTX
2011 NetUG HH: ASP.NET MVC & HTML 5
Daniel Fisher
 
PPTX
MVC 6 - the new unified Web programming model
Alex Thissen
 
PPTX
SoCal Code Camp 2011 - ASP.NET MVC 4
Jon Galloway
 
PPTX
MVC & SQL_In_1_Hour
Dilip Patel
 
PPTX
ASP.NET Presentation
Rasel Khan
 
PPTX
MVC Framework
Ashton Feller
 
PDF
Asp 1-mvc introduction
Fajar Baskoro
 
PPTX
Mvc summary
Muhammad Younis
 
PPTX
Asp.Net MVC 5 in Arabic
Haitham Shaddad
 
PDF
Targeting Mobile Platform with MVC 4.0
Mayank Srivastava
 
PPTX
ZZ BC#7.5 asp.net mvc practice and guideline refresh!
Chalermpon Areepong
 
PDF
CG_CS25010_Lecture
Connor Goddard
 
ZZ BC#7 asp.net mvc practice and guideline by NineMvp
Chalermpon Areepong
 
Aspnetmvc 1
Fajar Baskoro
 
SoCal Code Camp 2011 - ASP.NET 4.5
Jon Galloway
 
ASP.NET - Building Web Application..in the right way!
Fioriela Bego
 
ASP.NET - Building Web Application..in the right way!
Commit Software Sh.p.k.
 
Building Modern Websites with ASP.NET by Rachel Appel
.NET Conf UY
 
Introduction to ASP.NET MVC
Joe Wilson
 
Asp.net With mvc handson
Prashant Kumar
 
2011 NetUG HH: ASP.NET MVC & HTML 5
Daniel Fisher
 
MVC 6 - the new unified Web programming model
Alex Thissen
 
SoCal Code Camp 2011 - ASP.NET MVC 4
Jon Galloway
 
MVC & SQL_In_1_Hour
Dilip Patel
 
ASP.NET Presentation
Rasel Khan
 
MVC Framework
Ashton Feller
 
Asp 1-mvc introduction
Fajar Baskoro
 
Mvc summary
Muhammad Younis
 
Asp.Net MVC 5 in Arabic
Haitham Shaddad
 
Targeting Mobile Platform with MVC 4.0
Mayank Srivastava
 
ZZ BC#7.5 asp.net mvc practice and guideline refresh!
Chalermpon Areepong
 
CG_CS25010_Lecture
Connor Goddard
 
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
Understanding The True Cost of DynamoDB Webinar
ScyllaDB
 
PDF
ArcGIS Utility Network Migration - The Hunter Water Story
Safe Software
 
PDF
FME as an Orchestration Tool with Principles From Data Gravity
Safe Software
 
PPTX
Paycifi - Programmable Trust_Breakfast_PPTXT
FinTech Belgium
 
PDF
How to Comply With Saudi Arabia’s National Cybersecurity Regulations.pdf
Bluechip Advanced Technologies
 
PDF
Bridging CAD, IBM TRIRIGA & GIS with FME: The Portland Public Schools Case
Safe Software
 
PDF
Automating the Geo-Referencing of Historic Aerial Photography in Flanders
Safe Software
 
PDF
Next level data operations using Power Automate magic
Andries den Haan
 
PDF
LLM Search Readiness Audit - Dentsu x SEO Square - June 2025.pdf
Nick Samuel
 
PPTX
MARTSIA: A Tool for Confidential Data Exchange via Public Blockchain - Pitch ...
Michele Kryston
 
PPTX
01_Approach Cyber- DORA Incident Management.pptx
FinTech Belgium
 
PPTX
Reimaginando la Ciberdefensa: De Copilots a Redes de Agentes
Cristian Garcia G.
 
PDF
Enhancing Environmental Monitoring with Real-Time Data Integration: Leveragin...
Safe Software
 
PDF
Unlocking FME Flow’s Potential: Architecture Design for Modern Enterprises
Safe Software
 
PPTX
Smart Factory Monitoring IIoT in Machine and Production Operations.pptx
Rejig Digital
 
PPTX
Enabling the Digital Artisan – keynote at ICOCI 2025
Alan Dix
 
PPTX
Smarter Governance with AI: What Every Board Needs to Know
OnBoard
 
PDF
How to Visualize the ​Spatio-Temporal Data Using CesiumJS​
SANGHEE SHIN
 
PDF
Darley - FIRST Copenhagen Lightning Talk (2025-06-26) Epochalypse 2038 - Time...
treyka
 
PPSX
Usergroup - OutSystems Architecture.ppsx
Kurt Vandevelde
 
Understanding The True Cost of DynamoDB Webinar
ScyllaDB
 
ArcGIS Utility Network Migration - The Hunter Water Story
Safe Software
 
FME as an Orchestration Tool with Principles From Data Gravity
Safe Software
 
Paycifi - Programmable Trust_Breakfast_PPTXT
FinTech Belgium
 
How to Comply With Saudi Arabia’s National Cybersecurity Regulations.pdf
Bluechip Advanced Technologies
 
Bridging CAD, IBM TRIRIGA & GIS with FME: The Portland Public Schools Case
Safe Software
 
Automating the Geo-Referencing of Historic Aerial Photography in Flanders
Safe Software
 
Next level data operations using Power Automate magic
Andries den Haan
 
LLM Search Readiness Audit - Dentsu x SEO Square - June 2025.pdf
Nick Samuel
 
MARTSIA: A Tool for Confidential Data Exchange via Public Blockchain - Pitch ...
Michele Kryston
 
01_Approach Cyber- DORA Incident Management.pptx
FinTech Belgium
 
Reimaginando la Ciberdefensa: De Copilots a Redes de Agentes
Cristian Garcia G.
 
Enhancing Environmental Monitoring with Real-Time Data Integration: Leveragin...
Safe Software
 
Unlocking FME Flow’s Potential: Architecture Design for Modern Enterprises
Safe Software
 
Smart Factory Monitoring IIoT in Machine and Production Operations.pptx
Rejig Digital
 
Enabling the Digital Artisan – keynote at ICOCI 2025
Alan Dix
 
Smarter Governance with AI: What Every Board Needs to Know
OnBoard
 
How to Visualize the ​Spatio-Temporal Data Using CesiumJS​
SANGHEE SHIN
 
Darley - FIRST Copenhagen Lightning Talk (2025-06-26) Epochalypse 2038 - Time...
treyka
 
Usergroup - OutSystems Architecture.ppsx
Kurt Vandevelde
 

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