Skip to main content

Posts Tagged ‘ASP.NET MVC’

Sitecore Beginners – Convert Sitecore Sample Site to MVC

The sample site that comes out of the box with Sitecore is still running on XSLT renderings and Web Forms sublayouts. Maybe you just finished the Sitecore Developers eLearning Course and want to play with Sitecore and MVC some more, or you’re starting your first Sitecore project and want something to do on the side. […]

Sitecore MVC – Use Value Providers to Bind from Sitecore

A few months ago a question popped up on Sitecore Stack Exchange about why parameters passed into the Html.Sitecore().ControllerRendering(string controllerName, string actionName, object parameters) method introduced in Sitecore 8.2 do not bind to the action parameters in the called action method. I answered why the parameters don’t bind and suggested that if you want this functionality, you […]

Sitecore MVC – Globally-Templated Attribute Routes

I’ve worked on a few projects that make use of John West‘s technique to create AJAX services for your Sitecore components, as outlined in his blog post here. In a fresh Sitecore project, the action methods on your controllers are accessible from Sitecore only–you can’t access them by navigating to http://{{yoursiteurl}}/{controller}/{action} like you would in a […]

Sitecore WFFM – View Compilation Error after Upgrade to 8.1

After fixing the controller not found exception following our client’s recent upgrade to Web Forms for Marketers 8.1, all of our forms continued to throw an exception on load: Compilation Error. CS0104: ‘Constants’ is an ambiguous reference between ‘Sitecore.Forms.Mvc.Constants’ and ‘SitecoreDemo.Constants’. Web Forms for Marketers installs several views and editor templates into your Sitecore installation at […]

Sitecore WFFM – Controller Not Found after Upgrade to 8.1

We recently upgraded one of our clients from Sitecore 8.0 to Sitecore 8.1 and had to upgrade to Web Forms for Marketers 8.1 rev. 160304 as part of the upgrade. After upgrading WFFM, all of our forms started to throw the following exception: The controller for path ‘{{form path}}’ could not be found. The project has a custom Controller Factory that uses […]

Sitecore MVC – Independent Experience Editor Views

I find that many of the components I develop in Sitecore need custom markup in the Experience Editor that shouldn’t be present on the live site. Although it’s possible to add this custom markup into my components’ views with @if (Sitecore.Context.PageMode.IsExperienceEditor), I prefer to keep branching logic out of my views as much as possible. Fortunately […]

Testing Sitecore With Test Driven Code

Testing is a necessary difficulty that we all must endure. The practice of Test Driven Development (TDD) doesn’t always make testing easier but I firmly believe it makes the development of software more predictable and reliable. Throughout my career I’ve been a part of many teams, both those disciplined in good testing practices and others […]

Declarative data caching in .NET business layer

One of the most effective ways to improve application performance is to implement data caching. Most of the applications are relatively retrieving the same data from external sources like database of web service and if that source data is never or seldom changes then application is just wasting CPU time and I/O querying the source […]

Windows Azure Cache Preview

Caching capabilities have been available in Windows Azure for a while now, at least for use in cloud services. With the latest improvements to Windows Azure caching is now its own service. Now you can use distributed caching with all your Windows Azure applications, whether your application is a Web Sites, VM, Cloud Service or […]

Using Pagination with Asynchronous Keyword Queries

Recently, I finished development on a SharePoint 2013 provider-hosted app that uses Keyword Query Language and the SharePoint Search API to run asynchronous queries against a site collection to grab all of the site collections under that domain name. What I found almost most troubling was figuring out a way not just to display these […]

Localizing Static Words in ASP.NET MVC Routing

Routing requests to actions within controllers is the backbone of any ASP.NET MVC web application.  Being able to define different routes by using static words, such as “Products” or “Search”, enables search engine optimized and user friendly URLs.  However, recently I was asked to localize those static words to maintain consistency in the way URLs […]