Open棟梁 wiki

[[戻る>FrontPage]]

*目次 [#p7e898af]
#contents

*P層 [#v39fadf2]

**マスターページ内でのExceptionについて [#o1573259]

***Q [#e2846d6c]
BaseMasterControllerを継承しているマスターページで~
Exceptionを発生させるとIISのエラーページに遷移してしまいます。

これをエラーページに遷移するように変えるにはどのようにすればよいでしょうか。

***A [#b796f891]
マスターページは、BaseMasterControllerでは、ルートのイベント・ハンドルをしていないので、~
マスターページ上でtry-catchして、MyBaseController.TransferErrorScreen2()を呼び出して下さい。
-以下のようにマスターページ上のコントロールのイベントハンドラをマスタページ上に実装可能です。~
https://github.com/OpenTouryoProject/OpenTouryo/blob/develop/root/programs/C%23/Samples/WebApp_sample/ProjectX_sample/Aspx/Common/sampleScreen.master.cs

**以下の例外が発生します。 [#y99c234c]
***Q [#w4c15e44]
「System.ArgumentException: 項目は既に追加されています。辞書のキー: 'SessionAbandonFlag' 追加されるキー: 'SessionAbandonFlag'」
-若しくは、マスターページ上でtry-catchして、MyBaseController.TransferErrorScreen2()を呼び出して下さい。

***A [#a8bfc245]
SessionAbandonFlagとは、

 /// <summary>
 /// システムエラー発生時、セッション削除フラグをHttpContextに設定~取得するためのキー
 /// <summary>
 public const string SESSION_ABANDON_FLAG = "SessionAbandonFlag"; 

-https://github.com/OpenTouryoProject/OpenTouryoTemplates/blob/master/root_VS2012/programs/C%23/Frameworks/Infrastructure/Framework/Util/FxHttpContextIndex.cs
-https://github.com/OpenTouryoProject/OpenTouryoTemplates/blob/master/root_VS2012/programs/C%23/Samples/WebApp_sample/ProjectX_sample/Aspx/Common/ErrorScreen.aspx.cs

というものなので、エラー処理でエラーが発生して、エラーのループが発生している可能性が高いです。

エラー処理系のカスタマイズなどを行いましたでしょうか?

-ErrorScreen.aspx.cs~
https://github.com/OpenTouryoProject/OpenTouryoTemplates/blob/master/root_VS2012/programs/C%23/Samples/WebApp_sample/ProjectX_sample/Aspx/Common/ErrorScreen.aspx.cs

-MyBaseController.TransferErrorScreen~
https://github.com/OpenTouryoProject/OpenTouryoTemplates/blob/master/root_VS2012/programs/C%23/Frameworks/Infrastructure/Business/Presentation/MyBaseController.cs#L792

-MyBaseController.TransferErrorScreen2~
https://github.com/OpenTouryoProject/OpenTouryoTemplates/blob/master/root_VS2012/programs/C%23/Frameworks/Infrastructure/Business/Presentation/MyBaseController.cs#L813

なお、ErrorScreen.aspxは、MyBaseControllerのベースクラスを継承したらダメです。

*B層 [#u909b623]

*D層 [#v5379033]

*その他 [#w601d544]

*問合せ [#j28b5c45]
不明点の問合せには、下記のメールアドレスか、Google Groupsを使用して下さい。

-touryo@hitachi-solutions.com
-https://groups.google.com/forum/?hl=ja#!forum/opentouryoproject


トップ   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS