Reputation: 11
I need to create a application which loads a html "template" file and parse them with current data values. So far no problemm but does anyone knows how to load the parsed html value into the cefsharp browser ?
I found some old topics here with an "loadHtml()" function. But this function isnt there anymore.
Thanks in advance
Upvotes: 0
Views: 1556
Reputation: 4420
You need to add a using CefSharp;
statement to your code to access the LoadHtml extensions methods.
chromiumWebBrowser.LoadHtml(html);
Upvotes: 1
Reputation: 2333
const string html = "<html><head><title>Test</title></head><body><h1>Html Encoded in URL!</h1></body></html>";
var base64EncodedHtml = Convert.ToBase64String(Encoding.UTF8.GetBytes(html));
browser.Load("data:text/html;base64," + base64EncodedHtml);
From the project wiki on github: Loading HTML/CSS/JavaScript/etc from disk/database/embedded resource/stream
Upvotes: 0