1

I want to use a WebBrowser-Control within a WebForm-App. It should load a local Webpage which includes several JS and Images. Is it possible to replace placeholderstrings within the JS before the page gets loaded? So something like that: get HTML->replace strings via string.replace(..,..)->load the new HTML into the control.

Thanks a lot!

zpete
  • 1,725
  • 2
  • 18
  • 31
  • 1
    It is quite unclear what 'local webpage' might mean. The answer is somewhere between string.Replace() and a proxy server. – Hans Passant Mar 09 '12 at 13:31
  • 1
    Perhaps you should consider downloading the website using DownloadString before you load it into the WebBrowser, that way you have access to the Html and js to do whatever modifications you need. But i don't think the webbrowser will be able to load the images, as their src attribute is relative, and if you load it locally after modifying it, the browser will most likely be looking for the images the wrong place. EDIT: Oh i though it was a external webpage, perhaps it will work, but i still have my doubts. – Moulde Mar 09 '12 at 13:33
  • Use this: http://stackoverflow.com/questions/2013050/asynchronous-pluggable-protocols – Jcl Mar 09 '12 at 14:24

0 Answers0