Skip to main content
Tab

ASPxObjectContainer.ObjectUrl Property

Gets or sets the location of the container object.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v24.1.dll

NuGet Package: DevExpress.Web

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).

<dx:ASPxObjectContainer runat="server" ID="FlashObjectContainer"
    Width="320px"
    Height="284px"
    ObjectUrl="~/Embed.emb?flash=true"
    ObjectType="Flash">
</dx:ASPxObjectContainer>
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