Reputation: 81
I want to run a Windows form app from ASP.net page when clicked on a ASP button. Now I don't want to show the app on ASP.net page, as I said earlier, I want to start it.
I'm calling the Windows form app directly behind a button but it is not working and giving errors. when I searched for it, I saw that we cannot call/run windows form app from ASP.net page. So any one who can give a better idea to achieve this task?
How about Client/server technique? So that when I pass a message from client (ASP.net page) to server (Win Form App), the app should run.
Please help!
Upvotes: 0
Views: 6088
Reputation: 150208
If you want to launch the WinForms app from a web page, the best approach is probably to use ClickOnce technology. It allows you to publish your application directly through a web page (no separate installer needed).
ClickOnce is a deployment technology that enables you to create self-updating Windows-based applications that can be installed and run with minimal user interaction. Visual Studio provides full support for publishing and updating applications deployed with ClickOnce technology if you have developed your projects with Visual Basic and Visual C#.
http://msdn.microsoft.com/en-us/library/t71a733d(v=vs.110).aspx
ClickOnce also works with C++ apps, but there are some additional steps
http://msdn.microsoft.com/en-us/library/ms235287.aspx
There's an excellent answer on Stack Overflow that reviews some things to be aware of. Suggest you read through that as well
https://stackoverflow.com/a/2365481/141172
If you want to launch your application (possibly including parameters) from a web page, one approach is to have the application register a protocol handler. A protocol handler allows an application to react to a URL with a new protocol that you define, e.g. myappname://TheFileToOpen
http://msdn.microsoft.com/en-us/library/aa767914(v=vs.85).aspx
Upvotes: 4