Share via


SilverlightPlugin.CreateObject Method

Writes the object element and parameters for the Silverlight content.

Namespace:  System.Web.UI.SilverlightControls
Assembly:  System.Web.Silverlight (in System.Web.Silverlight.dll)

Syntax

'Declaration
Public Overridable Sub CreateObject ( _
    control As Control, _
    writer As HtmlTextWriter, _
    parentId As String _
)
'Usage
Dim instance As SilverlightPlugin
Dim control As Control
Dim writer As HtmlTextWriter
Dim parentId As String

instance.CreateObject(control, writer, _
    parentId)
public virtual void CreateObject(
    Control control,
    HtmlTextWriter writer,
    string parentId
)

Parameters

  • control
    Type: Control
    The control instance.
  • writer
    Type: HtmlTextWriter
    An HtmlTextWriter instance.
  • parentId
    Type: System.String
    The element where the Silverlight content is inserted.

Remarks

This method is typically used to instantiate this class from a custom control’s Render method.

You set properties such as Source, Windowless, and Background. You then render a placeholder (for example, a div or span element) to contain the Silverlight object element.

This method requires the control instance because it might register scripts on your behalf. The writer instance is passed into the Render method to write the object element and parameters. The parentId parameter is the ID of the placeholder where the Silverlight content is inserted.

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

See Also

Reference

SilverlightPlugin Class

SilverlightPlugin Members

System.Web.UI.SilverlightControls Namespace