Skip to main content
A newer version of this page is available. .
Tab

ASPxBinaryImage.BinaryStorageMode Property

Gets or sets a value that specifies the storage of binary data.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v18.2.dll

Declaration

[DefaultValue(BinaryStorageMode.Default)]
public BinaryStorageMode BinaryStorageMode { get; set; }

Property Value

Type Default Description
BinaryStorageMode **Default**

One of the BinaryStorageMode enumeration values.

Available values:

Name Description
Default

The Cache mode is used if another configuration isn’t defined by the BinaryStorageConfigurator.Mode field.

Cache

Binary data is stored within a cache.

Session

Binary data is stored within a session.

Custom

Custom mode provides for implementing a custom scenario for storing and accessing binary data.

Remarks

This property is a wrapper of the BinaryImageEditProperties.BinaryStorageMode property.

Example

// Developer Express Code Central Example:
// How to implement custom binary storage configuration
// 
// This example demonstrates how to implement different storage strategies for the
// DevExpress control's binary images.
// 
// The FileCacheStrategy scenario implies
// the use of a specific folder on the server for storing the ASPxGauge's binary
// images. Changing the control's value causes generating its new image, which is
// stored into a specified folder. Cache is cleared every 10 minutes. Each image
// can be obtained by using its recourse key. The StaticImageStrategy scenario
// implements storing the ASPxGridView binary data (a specific column with binary
// images) into a public folder within an application. Each image within the folder
// has its own static URL. In this scenario, cache is cleared every 60
// minutes.
// 
// See Also:
// Binary Storage Configuration
// (https://documentation.devexpress.com/AspNet/6874/Common-Concepts/Web-Farm-and-Web-Garden-Support/Binary-Storage-Configuration)
// 
// You can find sample updates and versions for different programming languages here:
// http://www.devexpress.com/example=E1570

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using DevExpress.Web.Internal;

public partial class CacheSample : System.Web.UI.Page {
    protected void Page_Load(object sender, EventArgs e) {
    }

    public void ASPxGridView1_HtmlDataCellPrepared(object sender, DevExpress.Web.ASPxGridViewTableDataCellEventArgs e) {
        if (e.DataColumn.FieldName == "Picture")
            (e.Cell.Controls[0] as BinaryImageDisplayControl).Attributes.Add("data-key", e.KeyValue.ToString());
    }

    protected void ASPxButton1_Click(object sender, EventArgs e) {
        Random rnd = new Random();
        gaugeControl1.Value = rnd.Next(100).ToString();
    }

}
See Also