Tag Archives: c#

Can I Ride released

My first Windows Phone 8 app was approved and published to the Windows Store last week. It’s a simple live tile that takes advantage of background tasks and the location api. It’s available for download here.

Posted in it | Tagged , , | Leave a comment

BNS error. The maximum number of ScheduledActions of this type have already been added.

In setting up a PeriodicTask in my Windows Phone 8 project, I ran into an error while debbugging: BNS error. The maximum number of ScheduledActions of this type have already been added. This occurs when there is already a PeriodicTask … Continue reading

Posted in it | Tagged , , , | Leave a comment

Access referring page in asp.net

In an asp.net web application, the referring page can be accessed via the Request object. This is useful for controls that redirect to the previous page. To access the local path and store it to ViewState, use:

It’s also … Continue reading

Posted in it | Tagged , , | Leave a comment

LINQ to Entities does not recognize method

I run into this NotSupportedException more often than I should: “LINQ to Entities does not recognize the method ‘System.String ToString()’ method, and this method cannot be translated into a store expression.” It’s a simple fix, but it always slips my … Continue reading

Posted in it | Tagged , , | Leave a comment

Check Sitecore item presentation

There are many times when I’ve had to implement business logic that depended on whether or not Sitecore items had presentation details set. For example, in a site-wide page search, it wouldn’t make much sense to return links to items … Continue reading

Posted in it | Tagged , , , | Leave a comment

Access parent DataItem in nested repeater

Every once in a while a presentation comes along that requires multiple nested repeaters. The majority of times I’ve encountered this, there is something special that needs to be done to the last item in the inner repeater. With one … Continue reading

Posted in it | Tagged , , | Leave a comment

Passing properties into Sitecore sublayouts

I’ve run into multiple situations where I’ve wanted to reuse most of a Sitecore sublayout/control with only one or two differences in the control’s properties. For example,  this has happened when I have chunks of markup that are entirely identical … Continue reading

Posted in it | Tagged , , , , | 2 Comments

Sitecore FieldRenderer class attribute

I spent hours trying to figure out how to set the class attribute of images rendered with the Sitecore FieldRenderer. Unfortunately, the CssClass attribute does not work on the FieldRenderer control as it does on the Image WebControl. Long after … Continue reading

Posted in it | Tagged , , , | Leave a comment

Sitecore current date in preview mode

To access the currently selected DateTime in the content editor’s preview mode, instead of checking the query string, use

Also, be sure to check if the page is in preview mode first. In my case, I had a presentation … Continue reading

Posted in it | Tagged , , , | Leave a comment

A gem

I stumbled upon some puzzling code the other day. It makes me wonder, what sort of direction is your code going if this is what you end up with? Unnecessary code omitted (unlike the snippet) to increase clarity.

Posted in it | Tagged , , | Leave a comment