C# Load HTML from resource

1,730 views
Skip to first unread message

Ribhararnus Pracutian

unread,
Sep 15, 2013, 12:55:57 PM9/15/13
to cefs...@googlegroups.com
hello, I'm newbie to desktop programming and CEF.
I want to load HTML from resource, is that possible ?

Trond Andersen

unread,
Sep 15, 2013, 3:29:48 PM9/15/13
to cefs...@googlegroups.com

I want to load HTML from resource, is that possible ?
When you say "from resource" do you think of Visual Studio project resource or any other kind? If you are thinking local resource it is possible to intercept a server-request and replace the response with your own local HTML files. Just look at the OnBeforeResourceLoad in ExamplePresenter.

Ribhararnus Pracutian

unread,
Sep 15, 2013, 10:14:12 PM9/15/13
to cefs...@googlegroups.com
yes resources from visual studio project, I'm using loadHtml after
webview loaded :

webView.LoadHtml(string.Format("<strong>I want this html from
resource</strong>")

the example you give me
https://github.com/cefsharp/CefSharp/blob/master/CefSharp.Example/ExamplePresenter.cs#L268
also the same with my method it's string, I want to read file from
resource and store as string in LoadHtml

Per Lundberg

unread,
Sep 16, 2013, 2:38:19 PM9/16/13
to cefs...@googlegroups.com
Hi Pracutian,

Sorry to ask, but what exactly is your question, more specifically? You already have there the example of how to feed the webView with any HTML you like; be it from a file, from a static string, from a server you connect to over the internet...

This forum is not intended to teach people basic concepts of things like WPF resource files (.resx). That's out of scope; there are other people (like StackOverflow and other forums) that can teach you these things better.

Sorry, not to mean rude, but it's quite important that we try to make this forum have a reasonable volume so that people will have time to read questions which relate to the actual usage of the control(s), CefSharp for Windows Forms and Windows Presentation Framework (WPF).

Best regards,
Per

Ribhararnus Pracutian

unread,
Sep 16, 2013, 7:04:11 PM9/16/13
to cefs...@googlegroups.com

okay, sorry I didn't know that this forum is for expert only, not for newbie like me..

I'll leave this forum. Thanks for your explanation.

Per Lundberg

unread,
Sep 16, 2013, 11:37:51 PM9/16/13
to cefs...@googlegroups.com
Hi,

You took my statement the wrong way; clearly, the forum is not for "experts only". Sorry that I gave you that impression. All I'm saying is that more general programming topics are better covered elsewhere.

Kind regards,
Per


On Tuesday, September 17, 2013, Ribhararnus Pracutian wrote:

okay, sorry I didn't know that this forum is for expert only, not for newbie like me..

I'll leave this forum. Thanks for your explanation.

--
You received this message because you are subscribed to a topic in the Google Groups "CefSharp" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cefsharp/ASZuNVf3a-I/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cefsharp+u...@googlegroups.com.
To post to this group, send email to cefs...@googlegroups.com.
Visit this group at http://groups.google.com/group/cefsharp.
For more options, visit https://groups.google.com/groups/opt_out.


--
mvh,
Per Lundberg
Reply all
Reply to author
Forward
0 new messages