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 nullptr.
Assembly: System.Web (in System.Web.dll)
public: virtual property String^ NullImageUrl { String^ get (); void set (String^ value); }
Property Value
Type: System::StringThe URL to an alternate image displayed when the value of a field is nullptr. 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 nullptr, 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 nullptr 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 nullptr.
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Note