0

I am working with a C# program which has a textbox txtPath and an HTML website that has another textbox txtWebPath. The website is written in JavaScript.

txtPath is being filled by openFileDialog, while txtWebPathis being filled via drag-and-drop. My goal is to have a button that sends txtPath value to txtWebPath.

Is there a way to do that?

2
  • The only way is to statically generate a html file where you insert the data. Normally you want a server and something that generates the website dynamically, like ASP.NET. Commented Jun 29, 2020 at 9:31
  • 1
    Is the website opened in a completely separate browser, or do you display it in a WebBrowser control inside your c# application? If you are using a WebBrowser control, you should be able to do it via the WebBrowser control's JS bindings. If it is in a separate browser, you would somehow have to match up the web application to the c# application and use some server side api with e.g. SignalR to send data to the browser. This will be a lot more difficult, though. Commented Jun 29, 2020 at 9:37

1 Answer 1

1

You could look into using WebSockets: they connect a server (the C# program in your case) with a web browser (in Javascript). You can find more about how you would write such programs here:

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.