Click here to Skip to main content
15,890,973 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,
I am coding a winform in C#. I added a JavaScript Class with name JSCode.js. Now I want call a function in JSCode.js like a class "*.cs".

Please guide me.
Posted
Comments
Sandeep Mewara 4-Jul-10 2:27am    
I really doubt you can use javascript in winforms?
Christian Graus 5-Jul-10 6:32am    
My guess is the OP has no idea how to code, googled for some code to do some basic function, found it in JS, and has no idea how to convert it, so he wants to use it as is.

If are using ASP.Net, you might want to have a look at this discussion here.
 
Share this answer
 
What you want to do exactly?

You are working with WinForm or WebForm?

How you have created class "JSCode.js" with having "." in name.
 
Share this answer
 
I am working with WinForm.

In the Visual Studio 2005, I "add new item" -> select "JScript File" and rename with "JSCode", it will exist in my project.

Any help?
 
Share this answer
 
Comments
Christian Graus 5-Jul-10 6:31am    
Why did you push 'answer' to ask a question ? Edit your post, or comment, like I did.
Abhishek Sur 5-Jul-10 6:43am    
I dont know why you need to run a JS code in winforms application? What type of facility you get using JS?
I am astounded by this question. Do you know what javascript is ? What it's used for ? why do you want to run it in your app ? you can, by putting a web browser control in your app, but I don't see why you'd want to.
 
Share this answer
 
Well, If you have the Engine to run your javascript, you can call the Javascript. You can even use the Dynamic capabilities of C# introduced recently to hold javascript objects etc.

Browser has inbuilt engine, so if you want to run your javascript, you need to add a WebBrowser control on your winforms application.

:rose:
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900