HyperLinkField.NavigateUrl プロパティ
アセンブリ: System.Web (system.web.dll 内)

Dim instance As HyperLinkField Dim value As String value = instance.NavigateUrl instance.NavigateUrl = value
/** @property */ public String get_NavigateUrl () /** @property */ public void set_NavigateUrl (String value)
HyperLinkField のハイパーリンクがクリックされたときの移動先の URL。既定値は空の文字列 ("") です。この値は、このプロパティが設定されていないことを示します。

HyperLinkField オブジェクトのハイパーリンクがクリックされたときの移動先となる URL を指定するには、NavigateUrl プロパティを使用します。このプロパティを設定した場合、すべてのハイパーリンクで同じナビゲーション URL が共有されます。
このプロパティを使ってハイパーリンクの URL を設定する代わりに、DataNavigateUrlFields プロパティを使用して、ハイパーリンクの URL をデータ ソース内のフィールドにバインドすることもできます。これにより、ハイパーリンクごとに異なる URL を割り当てることができます。
![]() |
---|
DataNavigateUrlFields プロパティと NavigateUrl プロパティの両方が設定されている場合は、DataNavigateUrlFields プロパティが優先されます。 |

NavigateUrl プロパティを使用して、HyperLinkField オブジェクトのハイパーリンクがクリックされたときの移動先となる Web ページを静的に指定する方法を次のコード例に示します。
<%@ Page language="VB" %> <html> <body> <form runat="server"> <h3>HyperLinkField Example</h3> <!-- Populate the Columns collection declaratively. --> <!-- Set the HyperLinkField field column to a static --> <!-- caption and URL. --> <asp:gridview id="OrdersGridView" datasourceid="OrdersSqlDataSource" autogeneratecolumns="false" runat="server"> <columns> <asp:boundfield datafield="OrderID" headertext="OrderID"/> <asp:boundfield datafield="CustomerID" headertext="Customer ID"/> <asp:boundfield datafield="OrderDate" headertext="Order Date" dataformatstring="{0:d}" /> <asp:hyperlinkfield text="Details..." navigateurl="~\details.aspx" headertext="Order Details" target="_blank" /> </columns> </asp:gridview> <!-- This example uses Microsoft SQL Server and connects --> <!-- to the Northwind sample database. --> <asp:sqldatasource id="OrdersSqlDataSource" selectcommand="SELECT [OrderID], [CustomerID], [OrderDate] FROM [Orders]" connectionstring="server=localhost;database=northwind;integrated security=SSPI" runat="server"> </asp:sqldatasource> </form> </body> </html>
<%@ Page language="C#" %> <html> <body> <form runat="server"> <h3>HyperLinkField Example</h3> <!-- Populate the Columns collection declaratively. --> <!-- Set the HyperLinkField field column to a static --> <!-- caption and URL. --> <asp:gridview id="OrdersGridView" datasourceid="OrdersSqlDataSource" autogeneratecolumns="false" runat="server"> <columns> <asp:boundfield datafield="OrderID" headertext="OrderID"/> <asp:boundfield datafield="CustomerID" headertext="Customer ID"/> <asp:boundfield datafield="OrderDate" headertext="Order Date" dataformatstring="{0:d}" /> <asp:hyperlinkfield text="Details..." navigateurl="~\details.aspx" headertext="Order Details" target="_blank" /> </columns> </asp:gridview> <!-- This example uses Microsoft SQL Server and connects --> <!-- to the Northwind sample database. --> <asp:sqldatasource id="OrdersSqlDataSource" selectcommand="SELECT [OrderID], [CustomerID], [OrderDate] FROM [Orders]" connectionstring="server=localhost;database=northwind;integrated security=SSPI" runat="server"> </asp:sqldatasource> </form> </body> </html>

Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からHyperLinkField.NavigateUrl プロパティを検索する場合は、下記のリンクをクリックしてください。

- HyperLinkField.NavigateUrl プロパティのページへのリンク