AssetControl
The AssetControl server control, when viewed on a Web form, displays a drag and drop icon that lets you upload a new asset or update an existing one. When you click this icon, a drag and drop box appears. This box is similar to the upload box in the Workarea. The difference between the Workarea and the server control is, in the Workarea users can only upload assets. With the AssetControl server control, you can upload a new asset or update an existing one by overwriting it. If the asset is overwritten, the previous version is available through Ektron’s history feature. See also: Managing Versions of Content.
The appearance of the AssetControl server control can vary depending on your browser. See also:Methods for Importing Assets.
Inserting the AssetControl server control onto a page
Prerequisite
You must have installed the server controls. See Installing server controls into Visual Studio Toolbox.
- In Visual Studio, choose View > Toolbox.
- Click the Ektron server control tab to display the server controls.
- Drag the AssetControl server control and drop it into the desired location on the page.
NOTE: You also can place the cursor on the page where you want the server control, then double click the server control that you want.
<CMS:AssetControl ID="AssetControl1" runat="server" />
- Click on
AssetControl
in the code to display and modify the control’s properties using the Properties window of Visual Studio. The page is updated as you modify the property values.
AssetControl properties
The following are Ektron-specific server controla server control uses API language to interact with the CMS and Framework UI to display the output. A server control can be dragged and dropped onto a Web form and then modified. properties. For information about native .NET properties such as font, height, width and border style, use Visual Studio® help.
- DefaultAssetID (Long)
The ID of the asset you want to update. This property is used when the
UploadType
property is set to Update. If you don’t know the ID number of the asset, use the CMS Explorer to browse to it. See also: Browsing your Ektron site using CMS Explorer - DefaultFolderID (Long)
The ID of the folder where assets are added. This property is used when the
UploadType
property is set to Add. If you don’t know the ID number of the folder, use the CMS Explorer to browse to it.See also: Browsing your Ektron site using CMS Explorer - DoInitFill (Boolean)
By default, Fill occurs during the Page_Init event. Set to false if you want to postpone the fill-action until later. In this case, Fill is automatically called during the Page Render event. You might do this if you need to set or change a property on the control in code-behind and have it render with your changes shown.
- DynamicParameter (String)
Gets or sets the QueryString parameter to read a content ID or folder ID dynamically. The content ID is read when the
UploadType
property is set to Update. The folder ID is read whenUploadType
property is set to Add. To use the default content ID or default folder ID, leave blank. - Hide (Boolean)
Hides or displays the output of the control in design time and run time.
- True. Hide the control output.
- False. Display the control output.
- IsImage (Integer)
Setting this control to 1 (one) restricts the control so only images can be uploaded.
- 1 (one). Restrict the control to uploading images only.
- 0 (zero). Upload all types of assets.
- 1 (one). Restrict the control to uploading images only.
- Language (Integer)
Set a language for viewing content; shows results in design-time (in Visual Studio) and at run-time (in a browser).
- OverrideExtension (String)
Lets you restrict the type of asset that can be uploaded by its extension. For example, to restrict the control to uploading Word documents, enter doc in the property.
NOTE: When using this property, enter only the extension’s letters not the wildcard (*) or the dot (.).
You can add multiple extensions by creating a comma separated list of extensions. You should limit the list to 5 extensions.
- SuppressWrapperTags (Boolean)
Suppresses the output of the span/div tags around the control.
- True. Suppress wrap tags.
- False (default). Allow wrap tags.
- TaxonomyID (Long)
The ID of the taxonomya content-level categorization system that uses one-to-many relationships (such as Ronald Reagan is to Actor, Governor, and President) to create a scalable organization of content. A taxonomy lets your site visitors navigate content independent of the folder structure. with which to associate the asset.
- UploadType (UploadTypeEnum)
Select whether the control adds new assets or updates existing ones.
- Add (default). Add assets and use the
DefaultFolderID
property. If a file of the same name already exists in the folder, the new file is created using the naming conventionfilename(2)
. - Update. Update assets. In this case, you must identify an asset at the
DefaultAssetID
property.
- Add (default). Add assets and use the
- WrapTag (String)
Lets a developer specify a server control’s tag.
- Span (default). Designate an inline portion of an HTML document as a span element.
- Div. Apply attributes to a block of code.
- Custom. Lets you use a custom tag.