リクエストが失敗したときに、独自のカスタム html ページに移動する必要があるシナリオがあります。私が直面している問題は、カスタム html ページで表示する必要がある背景画像があることです。
次のようにコードを実装しました。
CustomHtmlDoc = "<html><head></head><body background=\"{0}\"; oncontextmenu='return false;'><br><br></br></br><hr><h4 style='font-family:Footlight MT Light;color:red;font-size:20px;'>" + "ErrorMessage" + "</h4><h4 style='font-family:Footlight MT Light;color:red;font-size:25px;'>Please Verify the Configured URL from Dashboard Configuration</h4> <hr></body></html>";
string CustomHtmlDocument = string.Format(CustomHtmlDoc,AppDomain.CurrentDomain.BaseDirectory + "AdministrationUIBrowser\\AdministrationUIBrowserFactory\\ErrorBackground.png");
WebBrowserControlView.DocumentText = CustomHtmlDocument;
シナリオをローカルで実行しようとすると、バックグラウンドとしてエラー ページを取得できます。しかし、展開された最後に、背景画像のないコンテンツのみの空白の画面が表示されます。私のはWPFアプリケーションです。