Tab

ASPxObjectContainer.ObjectUrl Property

Gets or sets the location of the container object.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v21.1.dll

Declaration

[DefaultValue("")]
public string ObjectUrl { get; set; }

Property Value

Type Default Description
String

String.Empty

A String value that specifies the container object’s location.

Example

This demo shows how to display or play back a file in a multimedia format (flash, audio, video) when the file’s filename extension is not specified. In this case, you need to know the file’s MIME type and manually set the ASPxObjectContainer.ObjectType property to a corresponding value (Audio, Video, Flash, or Image).

View Example

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Web;

public class EmbedHttpHandler : IHttpHandler {
    public bool IsReusable {
        get { return false; }
    }

    public void ProcessRequest(HttpContext context) {
        context.Response.Clear();
        context.Response.ContentType = "application/x-shockwave-flash";
        context.Response.BinaryWrite(GetByteFile(context.Server.MapPath("~/Files/FlashClocks.swf")));
        context.Response.End();
    }

    public static byte[] GetByteFile(string filePath) {
        using(Stream fileStream = File.OpenRead(filePath)) {
            byte[] bytes = new byte[fileStream.Length];
            fileStream.Read(bytes, 0, (int)fileStream.Length);
            return bytes;
        }
    }
}
See Also