Back to Devexpress

ASPxObjectContainer Class

aspnet-devexpress-dot-web-42348313.md

latest7.1 KB
Original Source

ASPxObjectContainer Class

An ASPxObjectContainer control.

Namespace : DevExpress.Web

Assembly : DevExpress.Web.v25.2.dll

NuGet Package : DevExpress.Web

Declaration

csharp
public class ASPxObjectContainer :
    ASPxWebControl
vb
Public Class ASPxObjectContainer
    Inherits ASPxWebControl

Remarks

The ASPxObjectContainer control allows media data (flash, image, video, audio) to be present on a web page. The source of the media data is specified by the ASPxObjectContainer.ObjectUrl property. By default, the type of media data is automatically defined by the ASPxObjectContainer control. To customize the container object’s settings, use the ASPxObjectContainer.ObjectProperties property.

Create an ObjectContainer Control

Design Time

The ASPxObjectContainer control is available on the DX.25.2: 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.

aspx
<dx:ASPxObjectContainer ID="objectContainer" runat="server" ClientInstanceName="ClientObjectContainer"
    ObjectUrl="~/ObjectContainer/Files/RatingControl.mp4" ObjectType="Video">  
</dx:ASPxObjectContainer>

Run Time

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

    objectContainer.ClientInstanceName = "ClientObjectContainer";
    objectContainer.ObjectUrl = "~/ObjectContainer/Files/RatingControl.mp4";
    objectContainer.ObjectType = ObjectType.Video;
}
vb
Imports DevExpress.Web

Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
    Dim objectContainer As ASPxObjectContainer = New ASPxObjectContainer()
    objectContainer.ID = "objectContainer"
    Page.Form.Controls.Add(objectContainer)

    objectContainer.ClientInstanceName = "ClientObjectContainer"
    objectContainer.ObjectUrl = "~/ObjectContainer/Files/RatingControl.mp4"
    objectContainer.ObjectType = ObjectType.Video
End Sub

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.

Macromedia Shockwave Flash (SWF)

For more information on flash object settings, see FlashObjectProperties.

Image

The following types of images are supported: BMP, GIF, ICO, JPEG, PNG.

For more information on image object settings, see ImageObjectProperties.

Video

The following types of video files are supported: ASF, ASX, AVI, MP4, MPE, MPEG, MPG, WM, WMV, WMX, WVX.

For more information on video object settings, see VideoObjectProperties.

Audio

The following types of audio files are supported: AIF, AIFC, AIFF, AU, M4A, MID, MIDI, MP2, MP3, MPA, RMI, SND, WAV, WAX, WMA.

For more information on audio object settings, see AudioObjectProperties.

Note

The ASPxObjectContainer control provides you with a comprehensive client-side functionality, implemented using JavaScript code:

The control’s client-side API is enabled if the ASPxObjectContainer.EnableClientSideAPI property is set to true, or the ASPxObjectContainer.ClientInstanceName property is defined, or any client event is handled.

Note the ASPxClientObjectContainer object is disabled until the ASPxObjectContainer.ObjectUrl property is specified.

Implements

Show 14 items

IComponent

IDisposable

IParserAccessor

IDataBindingsAccessor

IControlBuilderAccessor

IControlDesignerAccessor

IExpressionsAccessor

IAttributeAccessor

IUrlResolutionService

INamingContainer

IPostBackDataHandler

IPostBackEventHandler

ICallbackEventHandler

IPropertiesOwner

Inheritance

Object Control WebControl ASPxWebControlBase ASPxWebControl ASPxObjectContainer

See Also

ASPxObjectContainer Members

DevExpress.Web Namespace