Hi, I'm using the C# webbrowser in order to automate the navigating to a web site, the website is using widgets whichs means a terrible javascript code behind.. For example, a TR that opens a new Tab, looks like this: "" And I want to say to C# to click this TR in order to open the tab, which means invoking the MU_function(event,this) or maybe MO_function(event,this)then MU_function(event,this). There's a way of communication between C# and Javascript: by doing something like : MyWebBrowser.Document.InvokeScript("alert", new string[] { "Hello World" });
by using System.Diagnostics namespace and doing : [ComVisible(true)] public partial class MainForm : Form .... This InvokeScript can also execute a javascript function in the page, so there's a possibility to invoke the MU_function(event,this).. (event: mouseup, this: the TR tag). Now the problem is: (event,this) have to be JavaScript objects!! How can we do this?? I was thinking for a while, I got an idea: what if we serialize the "event" which is a MouseEvent object and the "this" which is a HTMLElement, then deserializing them to 2 assembly types or whatever, in this case the code should looks like : MyWebBrowser.Document.InvokeScript("MU_function", new object[] { ObjEvent , Objthis }); Do you know how can we serialize to javascript object ??? I tried the XML one but I don't know how to make them in the function pamaretres!!!
A
aggla
@aggla
Posts
-
The C# webbrowser and Widgets -
What about being lateshohom67 : Don't you think it is "about what you produce and the quality of your work" as Steve0 thinks and I do ?
-
What about being lateI'm working in the IT department of an hotel chain. The whole work is made using Microsoft technologies (C#/ASP.NET/SQL Server ..) We're working on a new project since June. I see that I'm going good as I did all the tasks that I was asking for in time. But I'm having a problem, I've never been in regular time :) never came at 8 o'clock, always 8,30 - 9 sometimes till 9:30. Are you used to be late ? :confused: