Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calling a javascript function from C# 1

Status
Not open for further replies.

SebFr

Programmer
May 28, 2006
12
US
Hi,

I want to be able to call a JavaScript file from a C# Windows application. This is just a stand alone C# application.

What I want to be able to do is to execute this JavaScript file, think of it as a function, and be able to pass parameters into it and to receive a return result from it.

Any help is appreciate, thanks!

 
Have you tried using the ScriptControl.

Add Microsoft Script Control as a reference to your project (its available from the COM tab in the Add References dialog).


Once you have a reference to it, instantiate a ScriptControl object and one of its properties is Language. You will need to check MSDN help for the available options and exactly how to use it, but my guess is that it should do what you need.


Hope this helps.

[vampire][bat]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top