i am trying to check on the value of a property in order to set some variables.
however in this example (banneroption is a dropdown) i have set it to be "Image Only" but the code always goes to the else option... so i cannot be checking for the value correctly....
this is the code i am trying
if (@Model.Content.HasValue("bannerOption").Equals("Image only"))
checking a property value
i am trying to check on the value of a property in order to set some variables.
however in this example (banneroption is a dropdown) i have set it to be "Image Only" but the code always goes to the else option... so i cannot be checking for the value correctly....
this is the code i am trying
if (@Model.Content.HasValue("bannerOption").Equals("Image only"))
{
imageWidth = 960;
imageHeight = 180;
}
else
{
imageWidth = 785;
imageHeight = 180;
}
Try like this:
thanks very much, its working correctly now....
Great!
is working on a reply...