Table of Contents
TargetWindow Property

Gets or sets the target window to display NavigateUrl.

Syntax
 public String TargetWindow { get; set; }

Property Value

System.String

The string value represents the target of the window to open the NavigateUrl when the item is clicked.

This property is read/write.

Remarks

TargetWindow specifies in which window the browser should open NavigateUrl when an item is clicked. When the user clicks on an item, the navigation control will use window.open to load NavigateUrl. the value of TargetWindow property will be passed as the second parameter to window.open function.

The following table from MSDN shows the target name that Internet Explorer supports. Note that some of the names might only available in Internet Explorer.
Built-in TargetWindow names Meaning
Any name you specify The name of the target window
_blank Load the linked document into a new blank window. This window is not named.
_media Load the linked document into the HTML content area of the Media Bar. Available in Internet Explorer 6 or later.
_parent Load the linked document into the immediate parent of the document the link is in.
_search Load the linked document into the browser search pane. Available in Internet Explorer 5 or later.
_self Default. Load the linked document into the window in which the link was clicked (the active window).
_top Load the linked document into the topmost window.
For example, if you set an item's NavigateUrl to "http://www.yahoo.com", and want to open a new window when user clicks on the item, you can set TargetWindow property to "_blank".
MyMenu.TargetWindow="_blank";
See Also