Content Studio Web Content Management System
SystemObject
ContentStudio.SiteCodeBase
ContentStudio.Site.ActiveScriptingActiveScriptingBase
ContentStudio.Site.ActiveScriptingDocumentBase
ContentStudio.Site.ActiveScripting.DocumentInsertDocumentFromURL
Assembly: CS_SiteLib (in CS_SiteLib.dll) Version: 5.7.5016.0 (5.7.5016.0)
Top
Top
Top
Create an instance of this object, set the properties that does not have their default values you expect and call the invoke method.
This class can throw exceptions thus your code should be wrapped within try/catch statements in order to avoid the entire page to crash.
The code generated is the content of the externa source and HTML/XHTML compatibility cannot be determined in advance.
The following code snippet shows how you can include a web page dynamically via its URL into an ordinary Content Studio document.
To invoke the code add a new inline script block in the HTML-view within a block element:
[This is preliminary documentation and is subject to change.]
This class writes HTML from an external http source to the supplied stream or the default response stream.
The InsertDocumentFromURL class acts as the underlying engine for the InsertDocumentFromURL AS component.
Inheritance Hierarchy
ContentStudio.SiteCodeBase
ContentStudio.Site.ActiveScriptingActiveScriptingBase
ContentStudio.Site.ActiveScriptingDocumentBase
ContentStudio.Site.ActiveScripting.DocumentInsertDocumentFromURL
Namespace: ContentStudio.Site.ActiveScripting.Document
Assembly: CS_SiteLib (in CS_SiteLib.dll) Version: 5.7.5016.0 (5.7.5016.0)
Syntax
The InsertDocumentFromURL type exposes the following members.
Constructors
Name | Description | |
---|---|---|
InsertDocumentFromURL |
Initializes a new instance of the InsertDocumentFromURL class.
| |
InsertDocumentFromURL(Stream) |
Initializes a new instance of the InsertDocumentFromURL class.
|
Properties
Name | Description | |
---|---|---|
BackwardsComponentCompatibilityMode |
Sets or gets a value that indicates whether the code runs in backwards
compatibility component mode. The default value is false.
(Inherited from ActiveScriptingBase.) | |
ComponentName | Gets the name of the component (Overrides ActiveScriptingBaseComponentName.) | |
Conformance |
Gets a value which specifies which type of code a component can generate.
(Overrides ActiveScriptingBaseConformance.) | |
Domain |
Gets or sets the domain.
| |
ElementType |
Gets a value which specifies the type of outer element the component generates.
(Overrides ActiveScriptingBaseElementType.) | |
Encoding |
Sets or gets the encoding the component uses. The default encoding is
the UTF8 encoding without byte order mark.
(Inherited from ActiveScriptingBase.) | |
File |
Gets or sets the file at the Domain from where the content should be retrieved.
| |
ReplaceRelativeURL |
Gets or sets a value indicating whether to replace absolute Url with relative url:s.
| |
StripBody |
Gets or sets a value indicating whether to strip all html including and outside of the body element.
| |
UserName |
Gets or sets the name of the user.
|
Methods
Name | Description | |
---|---|---|
Equals | (Inherited from Object.) | |
GetHashCode | (Inherited from Object.) | |
GetType | (Inherited from Object.) | |
Invoke |
This method invokes the component and writes its content into the specified stream
| |
SetPassword |
Sets the password.
| |
ToString | (Inherited from Object.) |
Remarks
Examples
protected void Insert() { ContentStudio.Site.ActiveScripting.Document.InsertDocumentFromURL idfu = new ContentStudio.Site.ActiveScripting.Document.InsertDocumentFromURL(); try { idfu.Domain = "http://contentstudio.se"; idfu.File = "default.aspx"; idfu.StripBody = true; idfu.ReplaceRelativeURL = true; idfu.Invoke(); } catch(Exception ex) { Response.Write(String.Format("InsertDocumentFromURL:{0}", ex.Message)); } }
Note |
---|
The server side call is written in C#, for VB.NET you must remove the trailing semi-colon (;) |
<div> <% Insert();%> </div>
See Also