private void SetFileInfo(string sImageName, string sTemplateFolderPath)
{
string sFieldValue = sImageName;
if (String.IsNullOrEmpty(sFieldValue)) {
// if page itself has no image, see if the image had been specified directly
sFieldValue = this.ImageUrl;
}
if (String.IsNullOrEmpty(sFieldValue)) {
this.Visible = false;
}
if (!String.IsNullOrEmpty(sFieldValue) && !sFieldValue.StartsWith("/")) {
sFieldValue = sTemplateFolderPath + sFieldValue;
}
if (!String.IsNullOrEmpty(sFieldValue) && !File.Exists(HttpContext.Current.Server.MapPath(sFieldValue))) {
ContentPage cp = cu.GetContainerContentPage(this);
sFieldValue = sImageName;
if (String.IsNullOrEmpty(sFieldValue)) {
sFieldValue = this.ImageUrl;
}
if (cp != null) {
if (!String.IsNullOrEmpty(sFieldValue) && !sFieldValue.StartsWith("/")) {
sFieldValue = cp.TemplateFolderPath + sFieldValue;
}
}
}
if (PerformURLResize && !String.IsNullOrEmpty(sFieldValue)) {
sFieldValue = String.Format("/carrotwarethumb.axd?scale={0}&thumb={1}&square={2}", ScaleImage, HttpUtility.UrlEncode(sFieldValue), ThumbSize);
}
this.ImageUrl = sFieldValue;
}