Why doesn't the compiler find my razor helpers in an Orchard theme?
问题 I would like to share among views the logic for creating an img tag from a mediaPart. I have already created the following razor helper method: @helper CreateImgFromMediaPart(dynamic mediaPart, int width = 150) { var imgSrc = mediaPart != null ? mediaPart.MediaUrl : string.Empty; var imgAlt = mediaPart != null ? mediaPart.AlternateText : string.Empty; <img alt="@imgAlt" src="@imgSrc" /> } I have tried this by creating an App_Code folder, putting into it a MyHelpers.cshtml file, and putting in