ImageField::NullImageUrl Property
Gets or sets the URL to an alternate image displayed in an ImageField object when the value of the field specified by the DataImageUrlField property is null.
Assembly: System.Web (in System.Web.dll)
public: property String^ NullImageUrl { virtual String^ get(); virtual void set(String^ value); }
Property Value
Type: System::String^The URL to an alternate image displayed when the value of a field is null. The default is an empty string (""), which indicates that this property is not set.
When the value of the field specified by the DataImageUrlField property is null, an image cannot be displayed in an ImageField object. Use the NullImageUrl property to specify the URL to an alternate image to display. The alternate image is usually an image that indicates that the normal image is not available or cannot be found.
Note |
|---|
As an alternative, you can simply display text when the field value is null by setting the NullDisplayText property instead of this property. If the NullImageUrl and NullDisplayText properties are both set, the NullImageUrl property has precedence. |
The following example demonstrates how to use the NullImageUrl property to specify the URL to an alternate image to display when the value of the field specified by the DataImageUrlField property is null.
Available since 2.0
