ImageField::NullDisplayText Property
Gets or sets the text to display 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^ NullDisplayText { virtual String^ get(); virtual void set(String^ value); }
Property Value
Type: System::String^The text to display 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 NullDisplayText property to specify the text to display in the image's place. The text usually indicates that the normal image is not available or cannot be found.
Note |
|---|
As an alternative, you can display an alternate image when the field value is null by setting the NullImageUrl property instead of this property. If the NullImageUrl and NullDisplayText properties are both set, the NullImageUrl property has precedence. |
The value of this property, when set, can be saved automatically to a resource file by using a designer tool. For more information, see LocalizableAttribute and ASP.NET Globalization and Localization.
The following example demonstrates how to use the NullDisplayText property to specify the text to display when the value of the field specified by the DataImageUrlField property is null.
Available since 2.0
