Skip to main content
Tab

ASPxBinaryImage Class

Represents an editor capable of displaying images from a binary stream.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v24.1.dll

NuGet Package: DevExpress.Web

Declaration

public class ASPxBinaryImage :
    ASPxEdit,
    IImageEdit,
    IBinaryImageEditor

Remarks

The ASPxBinaryImage control can be used to display on the web page any valid image (supported by the requesting browser) taken from a binary stream.

ASPxBinaryImage

Create a BinaryImage Control

Design Time

The ASPxBinaryImage control is available on the DX.24.1: Common Controls toolbox tab in the Microsoft Visual Studio IDE.

Drag the control onto a form and customize the control’s settings, or paste the control’s markup in the page’s source code.

<dx:ASPxBinaryImage ID="BinaryImage" runat="server" Width="200" Height="200"
    ShowLoadingImage="true" LoadingImageUrl="~/Content/Loading.gif" >
    <EditingSettings Enabled="true" />
</dx:ASPxBinaryImage>

Run Time

using DevExpress.Web;
...
protected void Page_Load(object sender, EventArgs e)
{
    ASPxBinaryImage binaryImage = new ASPxBinaryImage();
    binaryImage.ID = "BinaryImage";
    Page.Form.Controls.Add(binaryImage);

    binaryImage.Width = 200;
    binaryImage.Height = 200;
    binaryImage.ShowLoadingImage = true;
    binaryImage.LoadingImageUrl = "~/Content/Loading.gif";
    binaryImage.EditingSettings.Enabled = true;
}

Note

DevExpress controls require that you register special modules, handlers, and options in the Web.config file. You can change this file or switch to the Design tab in the Microsoft Visual Studio IDE to automatically update the Web.config file. Note that this information is automatically registered if you use the DevExpress Template Gallery to create a project.

This class inherits its basic functionality from its ancestor. The ASPxBinaryImage.ContentBytes property provides access to the editor’s contents represented by an array of bytes. The ASPxBinaryImage.StoreContentBytesInViewState property allows you to control whether the editor’s content should be stored within the editor’s view state between postbacks.

Note

Use the ASPxImage control to use the URL path to show an image from the server side.

See Also