Monthly Archives: May 2013

Strongly typed repeaters in ASP.NET 4.5 (Sitecore 7)

If you use Web Forms then this might be helpful.

In a Repeater (and other data binding container controls) instead of something like this:

<%# ((Sitecore.Data.Items.Item)Container.DataItem)["Field"] %>

You can now do this:

<%# Item["Field"] %>

If you include this Repeater attribute:

ItemType="Sitecore.Data.Items.Item"

We can do this with Sitecore 7 J

For more information http://stackoverflow.com/questions/937244/strong-typed-container-in-webforms

Debug compiled code on a remote server

This might come in handy sometime if you really need to debug something on a server where you can’t run (or connect to) a remote debugger.

  • Upload the codebase (src and sln) to the web server (from the correct branch)
  • Open sln in Visual Studio 2012 Express on the server
  • Change web config debug = true
  • Open web site project properties, web, set the server to Use Custom Web Server,  put the site URL in
  • Press play
  • You are now debugging on the server