I'm currently developing an in-house web-application in visual basic (by hand, not using VB program.). I'm using one browser window to display 4 frames of different type of data and controls. On click of a button, I want to collect data and change the pages displayed in 2 of the frames. My problem is changing the pages in the 2 frames. Any suggestions?
In visual basic, how do you reload frames with new pages?
Are you using th WebBrowser control? It has a Navigate() method. One of its parameters allows you to specify a target for the newly loaded page. See the description of the TargetFrameName parameter below; you can set its value to WindowName: a named HTML frame.
Navigate() Method
Navigates to a resource identified by a URL or to a file identified by a full path.
SYNTAX:
object.Navigate( _
url As String, _
[Flags As Variant,] _
[TargetFrameName As Variant,] _
[PostData As Variant,] _
[Headers As Variant])
PARAMETERS
url:
Required. A String expression that evaluates to the URL, full path, or Universal Naming Convention (UNC) location and name of the resource to display.
Flags:
Optional. A constant or value that specifies a combination of the values defined by the BrowserNavConstants enumeration.
TargetFrameName:
Optional. A case-sensitive string expression that evaluates to the name of the frame in which to display the resource. The possible values for this parameter are.
1) _blank
Load the link into a new unnamed window.
2) _parent
Load the link into the immediate parent of the document the link is in.
3) _self
Load the link into the same window the link was clicked in.
4) _top
Load the link into the full body of the current window.
5) WindowName
A named HTML frame. If no frame or window exists that matches the specified target name, a new window is opened for the specified link.
PostData:
Optional. Data that is sent to the server as part of a HTTP POST transaction. A POST transaction is typically used to send data gathered by an HTML form. If this parameter does not specify any post data, this method issues an HTTP GET transaction. This parameter is ignored if the URL is not an HTTP URL.
Headers:
Optional. A String that contains additional HTTP headers to send to the server. These headers are added to the default Microsoft Internet Explorer headers. For example, headers can specify the action required of the server, the type of data being passed to the server, or a status code. This parameter is ignored if the URL is not an HTTP URL.
___________________
REMARKS:
The WebBrowser control or InternetExplorer object can browse to any location in the local file system, on the network, or on the World Wide Web.
In Internet Explorer 6 or later, you can navigate through code only within the same domain as the application hosting the WebBrowser control. Otherwise, this method and Navigate2 are disabled.
In Windows Internet Explorer 7, when you specify the navOpenInNewTab flag or the navOpenInBackgroundTab flag, do not combine them with other parameters (TargetFrameName, PostData, Headers) or with other BrowserNavConstants flags. If tabbed browsing is disabled, or if a tab cannot be created, the call will fail. If this happens, choose another navigation method, such as navOpenInNewWindow.
NOTE
New tabs are opened asynchronously; this method returns as soon as the tab is created, which can be before navigation in the new tab has started. The IWebBrowser2 object for the destination tab is not available to the caller. Tab order is not guaranteed, especially if this method is called many times quickly in a row.
When navOpenInNewWindow or navOpenInNewTab is specified, the caller does not receive a reference to the WebBrowser object for the new window, so there is no immediate way to manipulate it.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment