HttpRequest.UrlReferrer プロパティ

定義

現在の URL にリンクされている、クライアントが前回要求した URL に関する情報を取得します。

public:
 property Uri ^ UrlReferrer { Uri ^ get(); };
public Uri UrlReferrer { get; }
member this.UrlReferrer : Uri
Public ReadOnly Property UrlReferrer As Uri

プロパティ値

Uri

Uri オブジェクト。

例外

HTTP Referer 要求ヘッダーの形式が正しくなく、Uri オブジェクトに変換することはできません。

次のコード例では、クライアントを現在のアプリケーションに参照した URL の 2 つのプロパティの値を表示します。

Uri MyUrl = Request.UrlReferrer;
 Response.Write("Referrer URL Port: " + Server.HtmlEncode(MyUrl.Port.ToString()) + "<br>");
 Response.Write("Referrer URL Protocol: " + Server.HtmlEncode(MyUrl.Scheme) + "<br>");

Dim MyUrl As Uri = Request.UrlReferrer
 Response.Write("Referrer URL Port: " & Server.HtmlEncode(MyUrl.Port.ToString()) & "<br>")
 Response.Write("Referrer URL Protocol: " & Server.HtmlEncode(MyUrl.Scheme) & "<br>")
   

適用対象