Page.Server プロパティとは? わかりやすく解説

Page.Server プロパティ

HttpServerUtility クラスインスタンスである Server オブジェクト取得します

名前空間: System.Web.UI
アセンブリ: System.Web (system.web.dll 内)
構文構文

Dim instance As Page
Dim value As HttpServerUtility

value = instance.Server
public HttpServerUtility Server { get; }
public:
property HttpServerUtility^ Server {
    HttpServerUtility^ get ();
}
/** @property */
public HttpServerUtility get_Server ()
public function get Server
 () : HttpServerUtility

プロパティ
ページ関連付けられている現在の Server オブジェクト

解説解説
使用例使用例

Server オブジェクト使用してサーバーからエラー情報アクセスする方法次のコード例示します。この例では、要求されURLRequest オブジェクトから取得し、(GetLastError メソッド使用して) 直前エラーServer オブジェクトから取得して、この両方クライアント表示できる文字列変換してます。message 変数クライアント書き込まれると、ClearError メソッド使用してエラー削除されます。

Protected Sub Page_Error(ByVal
 sender As Object, ByVal
 e As System.EventArgs)
  
  Dim sb As New StringBuilder()
  sb.Append("URL that caused the error: <br/>")
  sb.Append(Server.HtmlEncode(Request.Url.ToString()))
  sb.Append("<br/><br/>")
  sb.Append("Error message: <br/>")
  sb.Append(Server.GetLastError().ToString())
  Response.Write(sb.ToString())
  Server.ClearError()    

End Sub
protected void Page_Error(object sender, EventArgs
 e)
{
  StringBuilder sb = new StringBuilder();
  sb.Append("URL that caused the error: <br/>");
  sb.Append(Server.HtmlEncode(Request.Url.ToString()));
  sb.Append("<br/><br/>");
  sb.Append("Error message: <br/>");
  sb.Append(Server.GetLastError().ToString());
  Response.Write(sb.ToString());
  Server.ClearError();
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
Page クラス
Page メンバ
System.Web.UI 名前空間
HttpServerUtility



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「Page.Server プロパティ」の関連用語

Page.Server プロパティのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



Page.Server プロパティのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2024 Microsoft.All rights reserved.

©2024 GRAS Group, Inc.RSS