O
ofiras
Hi,
I've tried my luck invoking a JS function like it was called by an
input HtmlElement that is in the document in the WebBrowser from C#. I
tried "InvokeScript" to the document with the function I want, but it
didn't work (probably because it should be called by the input
element), I've tried changing the OuterHtml of the element inserting a
"onfocus" event to it and calling it with "RaiseEvent" and also
HtmlElement.Focus but it also didn't work (On debug mode I found out
that the OuterHtml didn't even change...) and I also tried changing it
from the WebBrowser.document.Body.InnerHtml and it didn't change too.
I've also tried using HtmlElement.InvokeMember calling the method I
want with the argument I want but it didn't work either (I have no
idea why).
Is there a way doing it?
I want to do it since there is an "onclick" event to this input
element, and it dose the function I want, but before that he calls
another function that opens a confirm messagebox, and I want the
process to be fully automatic. I've tried changing the function that
calls the confirm messagebox (I posted here a question) and I also
tried pressing the OK button automatically by C# (also posted here...)
but both didn't work.
I almost succeeded doing it, when I changed the function that calls
the confirm messagebox, but it only works when I press the input
manually, and when I invoke the event with "RaiseEvent" from C# it
works like I didn't change a thing. I noticed that when I did it, the
WebBrowser.DocumentText didn't change while the
WebBrowser.Document.Body.InnerHtml did change. When I try changing the
WebBrowser.DocumentText it doesn't work since in reloads without the
URL path, therefore all of the links and script loadings don't work.
I am desperate, please save me!
I would be very grateful for it, I'm stuck on this problem for
weeks... There must be a way doing it! Any solution for one of the
things I've tried will help!
Please help me,
Ofir.
I've tried my luck invoking a JS function like it was called by an
input HtmlElement that is in the document in the WebBrowser from C#. I
tried "InvokeScript" to the document with the function I want, but it
didn't work (probably because it should be called by the input
element), I've tried changing the OuterHtml of the element inserting a
"onfocus" event to it and calling it with "RaiseEvent" and also
HtmlElement.Focus but it also didn't work (On debug mode I found out
that the OuterHtml didn't even change...) and I also tried changing it
from the WebBrowser.document.Body.InnerHtml and it didn't change too.
I've also tried using HtmlElement.InvokeMember calling the method I
want with the argument I want but it didn't work either (I have no
idea why).
Is there a way doing it?
I want to do it since there is an "onclick" event to this input
element, and it dose the function I want, but before that he calls
another function that opens a confirm messagebox, and I want the
process to be fully automatic. I've tried changing the function that
calls the confirm messagebox (I posted here a question) and I also
tried pressing the OK button automatically by C# (also posted here...)
but both didn't work.
I almost succeeded doing it, when I changed the function that calls
the confirm messagebox, but it only works when I press the input
manually, and when I invoke the event with "RaiseEvent" from C# it
works like I didn't change a thing. I noticed that when I did it, the
WebBrowser.DocumentText didn't change while the
WebBrowser.Document.Body.InnerHtml did change. When I try changing the
WebBrowser.DocumentText it doesn't work since in reloads without the
URL path, therefore all of the links and script loadings don't work.
I am desperate, please save me!
I would be very grateful for it, I'm stuck on this problem for
weeks... There must be a way doing it! Any solution for one of the
things I've tried will help!
Please help me,
Ofir.