0
我有一個場景,當任何請求失敗時,我需要導航到我自己的自定義html頁面。我面臨的問題是我有一個背景圖片,我需要顯示自定義html頁面。將背景圖像加載到Web瀏覽器控件中的自定義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應用程序。
什麼是實際的'CustomHtmlDocument'內容的情況下,它不起作用。例如,這工作:\t \t \t'this.webBrowser.DocumentText = @「這是一個圖像:
」'。你有什麼? –
Noseratio
CustomHtmlDoc = @」
<體背景= \ 「{0} \」; oncontextmenu = '返回false;'>「+」ErrorMessage「+」
請確認儀表板配置的配置URL