BeforeNavigate

 

Description

 

Fired before any page navigation action (an action that would result in a different page being displayed) takes place. The container may veto the action completely or specify a different URL to be navigated to, a different target FRAME, different text for an HTTP POST operation or additional HTTP headers.

 

Arguments

 

Name

Type

I/O

Description

URL

String

Both

The URL of the page to be navigated to.

NavFlags

Long Integer

In

The OR of NavMasks constants specifying navigation options.

Nhandle

Long Integer

In

The ObjectHandle of the page providing the context for this navigation action.

TargetName

String

Both

The TARGET specification for this navigation.

TextToPost

String

Both

Text to include when using the HTTP POST method.

ExtraHeaders

String

Out

Additional HTTP headers to be issued with this navigation action.

Cancel

Boolean (by Reference)

Out

Leave False to allow this load to proceed, or set to True to veto loading of URL.

 

 

The NavFlags argument is the OR of these NavMasks:

 

NavGet

&H00000000

Uses the HTTP GET method.

NavPost

&H00000001

Uses the HTTP POST method.

NavHead

&H00000002

Uses the HTTP HEAD method.

NavHiddenLoad

&H00000004

This page will be loaded hidden.

NavNoReadFromCache

&H00000008

A fresh copy of this page will be loaded.

NavPresentInCache

&H00000010

This page is present in cache.

NavInFrameContext

&H00000020

This hyperlink originated in a FRAME page.

NavFormSubmit

&H00000040

This action originated in a user FORM submission.

NavContainerAction

&H00000080

This action was initiated by the container.

NavPageBack

&H00000100

This was a PageBack button action.

NavPageForth

&H00000200

This was a PageForth button action.

NavDontMakeCurrent

&H00000400

Page will be loaded to cache but not made current.

NavMetaRefresh

&H00000800

Action initiated by a META REFRESH.

NavUserHyperlink

&H00001000

Action initiated by a user hyperlink click.

 

Remarks

 

Any navigation action triggers this event, whether user-initiated, requested by the container, or the expiration of a META REFRESH timeout period. User navigation actions include hyperlink clicks, form submissions, direct URL entry, file open requests and toolbar button presses which load new pages such as PageBack or Home.

 

If the page specified by URL is already cached then the NavPresentInCache bit will be set in NavFlags. The NavNoReadFromCache bit in NavFlags indicates that a fresh copy of the page will be loaded even if the page is present in cache.

 

The container can ignore this event and allow the navigation action to proceed, or veto the navigation action by setting Cancel to True. It can also allow the operation to proceed to a different URL by setting the URL argument to a new destination, change the value of TargetName to request a different target FRAME, modify the text to be posted (if this is a POST action) by changing TextToPost, or request issuance of extra HTTP headers via ExtraHeaders.