Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. The C# webbrowser and Widgets

The C# webbrowser and Widgets

Scheduled Pinned Locked Moved C#
tutorialcsharpjavascriptxmlhelp
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    aggla
    wrote on last edited by
    #1

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

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups