HtmlTaskPane.Navigate method

Loads the specified HTML document into the custom task pane.

Namespace:  Microsoft.Office.InfoPath
Assembly:  Microsoft.Office.InfoPath (in Microsoft.Office.InfoPath.dll)

Syntax

'Declaration
Public MustOverride Sub Navigate ( _
    url As String _
)
'Usage
Dim instance As HtmlTaskPane
Dim url As String

instance.Navigate(url)
public abstract void Navigate(
    string url
)

Parameters

  • url
    Type: System.String

    The Uniform Resource Locator (URL) of the HTML document to navigate to.

Exceptions

Exception Condition
WebException

An error occurred while attempting to open the specified URL.

ArgumentNullException

The parameter passed to this method is a null reference (Nothing in Visual Basic).

ArgumentException

The parameter passed to this method is not valid. For example, it is of the wrong type or format.

Remarks

Note

The Navigate method cannot be called from an event handler for the Loading event because the view is not yet loaded when this event occurs, and task panes are associated with the view.

This member can be accessed only by forms running in the same domain as the currently open form, or by forms that have been granted cross-domain permissions.

This type or member can be accessed only from code running in forms opened in Microsoft InfoPath Filler.

Examples

In the following example, the Navigate method of the HtmlTaskPane class is used to load an HTML file into the custom task pane. The HTML document that it loads is one that has been added as a resource file of the form template.

// Get a reference to the custom task pane. 
// It is always index [0] in the TaskPanes collection.
HtmlTaskPane oTaskPane = (Microsoft.Office.InfoPath.HtmlTaskPane)
   (this.CurrentView.Window.TaskPanes[0]);

// Navigate to new task pane based on url specified.
oTaskPane.Navigate("taskpane2.html");
' Get a reference to the custom task pane. It is always index (0) in 
' the TaskPanes collection.
Dim oTaskPane As HtmlTaskPane = _
   DirectCast(Me.CurrentView.Window.TaskPanes(0), _
   Microsoft.Office.InfoPath.HtmlTaskPane)

' Navigate to new task pane based on url specified.
oTaskPane.Navigate("taskpane2.html")

See also

Reference

HtmlTaskPane class

HtmlTaskPane members

Microsoft.Office.InfoPath namespace