C # WebBrowser-Control: cómo reemplazar elementos de documento dinámicamente

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 antes the page gets loaded? So something like that: get HTML->replace strings via string.replace(..,..)->load the new HTML into the control.

¡Muchas gracias!

preguntado el 09 de marzo de 12 a las 13:03

It is quite unclear what 'local webpage' might mean. The answer is somewhere between string.Replace() and a proxy server. -

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. -

0 Respuestas

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.