|
| |||||||||
| Tags: document, foo, javascript, library, microsoft, mshtml, programing language, string, webbrowser, winform |
![]() |
| | Thread Tools | Search this Thread |
|
#1
| |||
| |||
| Javascript using C# WinForm
Hello folks, I am developing a program using the C# programing language. But the problem arise with the Javascript. I want to call Javascript in my code using the C# Winform, but i am not aware of the method to implement it using the same. So any one have knowledge regarding this can help me as i am a fresher so haven't much idea about the code. Is it possible to do so. A help may be appreciated. Thanks in advance |
|
#2
| ||||
| ||||
| Re: Javascript using C# WinForm
Hi there, If you want to use Javascript in a web page then i can help you with the procedure to call the same using C# Winform. The web page itself contain the control for the same. If you are discussing about the same then the Web Browsers Document property has an InvokeScript method which will automatically do the same. Code: this.WebBrowser.Document.InvokeScript("foo", new string[] { "Hiiiiiiiii" }); |
|
#3
| ||||
| ||||
| Re: Javascript using C# WinForm
Hi, I have the same issue as you are facing and i solved it with the Microsoft.mshtml library" to do this. This can help to call the javascript using the C# WinForm. Here is the code: Code: mshtml.IHTMLDocument doc = (mshtml.IHTMLDocument)axwebBrowser.Document;
mshtml.IHTMLWindow parentWin = doc.parentWindow;
parentWin.execScript("test(100)", "javascript"); |
|
#4
| ||||
| ||||
| Re: Javascript using C# WinForm
Hi, I something to tell you that you cant use C# to call the JavaScript because it is not a engine to perform the same. Only Internet Explorer can use JavaScript because it has the engine to do the same. And if you want to access DOM then you can do that with XmlDocument or XmlDataDocument classes. Web Browser control also have the functionality to do the same. Thanks. |
![]() |
|
| Thread Tools | Search this Thread |
| |
Similar Threads for: "Javascript using C# WinForm" | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| .net grid winform app | s398290 | Windows Software | 1 | 07-09-2011 12:05 PM |
| high performance grid for the .Net winform application | zannxy | Software Development | 1 | 29-08-2011 04:31 PM |
| Javascript in IE on HTC HD2 | dONGsUN | Portable Devices | 4 | 06-10-2010 06:56 AM |
| help with javascript please! | newbie1 | Software Development | 2 | 08-05-2010 12:09 PM |
| Unobtrusive Javascript | hatred | Software Development | 3 | 08-09-2009 02:03 PM |