Get an error when nothing is chosen in ContentPicker
Im getting an error on a contentpicker, when nothing is chosen in the contentpicker - The problem is that no matter what, the contentpicker always returns something:
If nothing is chosen in the contentpicker, then it still returns "umbraco.MacroEngines.DynamicXml " - So that means i can't check to see if it's empty, because it never is... So how do I do this?
var node = Library.NodeById(page.planetLink);
var graphic = page.Media("planetGraphic", "umbracoFile");
var gWidth = page.Media("planetGraphic", "umbracoWidth")+"px";
var gHeight = page.Media("planetGraphic", "umbracoHeight")+"px";
var gPositionX = page.planetXPosition+"px";
var gPositionY = page.planetYPosition+"px";
var gZindex = page.zIndex;
var planetTitle = page.planetTitle;
if (!string.IsNullOrEmpty(page.GetPropertyValue("planetLink")))
{
<div class="planet" style="width: @gWidth; height: @gHeight; position:absolute; top: @gPositionX; left:@gPositionY; z-index:@gZindex;">
<a href="@node.Url">
<img src="@graphic" width="@gWidth" height="@gHeight" alt="@planetTitle" title="@planetTitle" />
</a>
</div>
}
else
{
<div class="planet" style="width: @gWidth; height: @gHeight; position:absolute; top: @gPositionX; left:@gPositionY; z-index:@gZindex;">
<img src="@graphic" width="@gWidth" height="@gHeight" alt="@planetTitle" title="@planetTitle" />
</div>
}
Get an error when nothing is chosen in ContentPicker
Im getting an error on a contentpicker, when nothing is chosen in the contentpicker - The problem is that no matter what, the contentpicker always returns something:
If nothing is chosen in the contentpicker, then it still returns " umbraco.MacroEngines.DynamicXml " - So that means i can't check to see if it's empty, because it never is... So how do I do this?
I solved it... I just moved the "var node..... into the if"
The solution:
can check for those dynamicNull return types.
is working on a reply...