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

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > ViewStateException.Path プロパティの意味・解説 

ViewStateException.Path プロパティ

メモ : このプロパティは、.NET Framework version 2.0新しく追加されたものです。

ビューステート例外発生させた HTTP 要求パス取得します

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

解説解説

このプロパティは、ServerVariables プロパティPATH_INFO 変数と同じ値を返しますホスト名後に続くパス部分返されます。たとえば、URLhttp://www.contoso.com/virdir/page.html の場合Path は /virdir/page.html を返します

使用例使用例

base64 エンコードされた文字列を逆シリアル化して、プロパティ設定の ICollection コレクション返すメソッド実装方法次のコード例示します。Deserialize メソッドは、ViewStateException オブジェクト内部例外として持つ HttpException 例外スローできます。この例では、HttpException 例外キャッチして、ViewStateException オブジェクトからプロパティ取得する方法示します

Private Function LoadControlProperties(ByVal
 serializedProperties As String) As
 ICollection

    Dim controlProperties As ICollection =
 Nothing

    ' Create an ObjectStateFormatter to deserialize the properties.
    Dim formatter As New
 ObjectStateFormatter()

    Try
        ' Call the Deserialize method.
        controlProperties = CType(formatter.Deserialize(serializedProperties), ArrayList)
    Catch e As HttpException
        Dim vse As ViewStateException
        Dim logMessage As String

        vse = e.InnerException

        logMessage = "ViewStateException. Path: "
 + vse.Path + Environment.NewLine
        logMessage += "PersistedState: " + vse.PersistedState
 + Environment.NewLine
        logMessage += "Referer: " + vse.Referer +
 Environment.NewLine
        logMessage += "UserAgent: " + vse.UserAgent
 + Environment.NewLine

        LogEvent(logMessage)

        If (vse.IsConnected) Then
            HttpContext.Current.Response.Redirect("ErrorPage.aspx")
        Else
            Throw e
        End If
    End Try
    Return controlProperties
End Function 'LoadControlProperties
   
private ICollection LoadControlProperties(string
 serializedProperties)
{

    ICollection controlProperties = null;

    // Create an ObjectStateFormatter to deserialize the properties.
    ObjectStateFormatter formatter = new ObjectStateFormatter();

    try
    {
        // Call the Deserialize method.
        controlProperties = (ArrayList)formatter.Deserialize(serializedProperties);
    }
    catch (HttpException e)
    {
        ViewStateException vse = (ViewStateException)e.InnerException;
        String logMessage;

        logMessage = "ViewStateException. Path: " + vse.Path + Environment.NewLine;
        logMessage += "PersistedState: " + vse.PersistedState + Environment.NewLine;
        logMessage += "Referer: " + vse.Referer + Environment.NewLine;
        logMessage += "UserAgent: " + vse.UserAgent + Environment.NewLine;

        LogEvent(logMessage);

        if (vse.IsConnected)
        {
            HttpContext.Current.Response.Redirect("ErrorPage.aspx");
        }
        else
        {
            throw e;
        }
    }
    return controlProperties;
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
ViewStateException クラス
ViewStateException メンバ
System.Web.UI 名前空間



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

辞書ショートカット

すべての辞書の索引

「ViewStateException.Path プロパティ」の関連用語

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

   

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



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

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

©2024 GRAS Group, Inc.RSS