Gets or Sets the Base url of the Document. This is a very important property for handling relative path resources. For example, if you have many images in your html document with relative urls like <img src="myImage.jpg" /> etc, then, you can set this property to ant internet url or local file path to display that image in the editor. A very common usage of this property is to set the property programmatically when your Windows Form is loaded so that, when you ship your windows application to your user's pc, the relative resources are referenced correctly.
Namespace: SpiceLogic.WinHTMLEditor
Assembly: WinHTMLEditorControl (in WinHTMLEditorControl.dll)
Syntax
| Visual Basic (Declaration) |
|---|
| Public Property BaseUrl As String |
| C# |
|---|
| public string BaseUrl { get; set; } |
| C++ |
|---|
| public property string BaseUrl sealed { String get(); void set(String value); } |
| J# |
|---|
| /** property */ public string get_BaseUrl(); /** property */ public void set_BaseUrl(string value); |
| JScript |
|---|
| public function get BaseUrl() : String public function set BaseUrl(value : String); |
Example
The following snippet shows how you can best use of this property to show your relative resources in your Windows form when you ship your windows application to any where.
| CS | Copy Code
|
|---|---|
private void Form1_Load(object sender, EventArgs e)
{
htmlEditor1.BaseUrl = Application.StartupPath + "\\images";
} | |
| Visual Basic | Copy Code
|
|---|---|
Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs)
htmlEditor1.BaseUrl = Application.StartupPath & "\images"
End Sub | |