Customizing the WebBrowser control

S

scarleton

I am embeding the WebBrowser in my application to show reports. I
would like to embed the graphics and the CSS files in a resource. To
do this I need to "hook" the WebBrowser control so that when it goes
looking for these files, I can give it the files from the resource.
Any thoughts on how to do this? It does NOT look possible, at the
moment.

Sam
 
G

Guest

geez...I can only think of one way to really do this well...its a little
hairy, though.

Get the report Manually (via System.Web.HttpRequest). Then parse the
response text with a regex, looking for any <link> elements that hool in css
docs....remove those links and then add in the ones you want.
As for getting the css files out of the local assembly, you can always write
them to the temp directory and ahve the LINK elements use a file://
reference. I don't know if there's a way to get the resource out using the
res:// protocol....might be worth looking into, though
 
S

scarleton

David said:
geez...I can only think of one way to really do this well...its a little
hairy, though.

Get the report Manually (via System.Web.HttpRequest). Then parse the
response text with a regex, looking for any <link> elements that hool in css
docs....remove those links and then add in the ones you want.
As for getting the css files out of the local assembly, you can always write
them to the temp directory and ahve the LINK elements use a file://
reference. I don't know if there's a way to get the resource out using the
res:// protocol....might be worth looking into, though

Yea, I am currently doing something like that right now. I was hoping
that there was a way to intercept the WebBrowser control at some low
level so that it would give me a change to provide the external file
rather then it go looking for it. Oh well;)

Sam
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top