Jump to content

Executing JavaScript in C#

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
2 replies to this topic

#1
dirkfirst

dirkfirst

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 354 posts
So, how the h*ll do I execute JavaScript from C#? I've got the webbrowser control:

[HIGHLIGHT="C#"]
System.Windows.Forms.HtmlDocument document = this.webBrowser1.Document[/HIGHLIGHT]

and once I enter a value into a text box I need to execute a JavaScript function. Anyone have any methods to do this?

#2
Guest_Jordan_*

Guest_Jordan_*
  • Guests
You can use the InvokeScript() method.

document.InvokeScript("JavaFunction");


#3
dotnetrandz

dotnetrandz

    Newbie

  • Members
  • Pip
  • 2 posts
Check my blog for some tips on how to add javascripts on web controls. Here's the link.