1

Is there a good way to run a C# application on clientside in lieu of JavaScript? I have done some front end work with JavaScript and backend C# for web developing at an old job, but I am interested in hosting a website myself soon. I have a C# application I would like to be open source, but before people care to download I'd like them to be able to use it. At its basic level it's a simple text editor, but there's much more to it in the nitty gritty. I could write it in JavaScript, but it would require me to keep documentation and up to date changes on JavaScript and C# in that case.

I was thinking of creating an AJAX panel and somehow loading my winform application into a frame, but I don't know how or what words to google because I've never done it before except AJAX.

5
  • 1
    If you open source the project, maybe you can rely on the JavaScript expertise of others and learn something in the process?
    – JeffO
    Apr 22, 2014 at 15:52
  • I'm essentially trying to accomplish that...
    – Palmer
    Apr 22, 2014 at 16:33
  • 4
    Life would be so much easier if everyone could use C# instead of Javascript in web browsers. I'm talking white unicorns with naked woman riding them and throwing flower petals at your feet kind of better life.
    – Reactgular
    May 22, 2014 at 16:08
  • Would you not be able to preview your text editor in Silverlight? It's a dying plugin, but I think lots of people still have it from the point in time when Netflix used it, and it's a pretty fast/trusted install.
    – Katana314
    Jul 21, 2014 at 17:41
  • Maybe adapting mono for nacl? But that probably may need months of work.... Aug 20, 2014 at 17:49

2 Answers 2

2

An ASP.NET WebForms application will be your best bet in the short term.

Your skills at WinForms will be largely transferable, however you'll need to make yourself familiar with where you're WinForm is relying on persisted state objects. These pieces of data that need to be persisted throughout the lifetime of the application, that are not part of server-side controls themselves, will need to be manually persisted via either the ViewState or Session state.

WebForms is not an ideal technology for the stateless web, but it was designed for developers that are familiar with Winform development.

Diving into full-blown stateless MVC has a considerable learning curve if you aren't used to web development.

0

What capabilities do you have in C# that you feel are missing from Javascript? C# will run in a browser, but it will require your users to grant permission for a plugin. You don't want that.

Learn and use Javascript. Failing that, you can try writing an XBAP application.

7
  • "What capabilities do you have in C# that you feel are missing from Javascript?" – If I understood the question correctly, the most important capability missing from JavaScript is the application itself, which already exists and is already written in C#. The OP wants his potential users to be able to try out his desktop app on the web before downloading it. Apr 22, 2014 at 15:50
  • Correct, Jörg W Mittag.
    – Palmer
    Apr 22, 2014 at 15:56
  • Normally, one would install C# applications. Your user downloads and installs a trial version. If you want something that runs in a web browser and on a desktop, you would typically use HTML5/CSS3/Javascript for that. Apr 22, 2014 at 15:57
  • They would install the application once they download it. But you may be right. It may be more beneficial for me to rewrite in JavaScript so that it can be both hosted on web, and if I can find a useful way, usable as desktop application. I've never attempted creating JavaScript that doesn't run in a web browser. I have research to do on how that works.
    – Palmer
    Apr 22, 2014 at 16:15
  • Why don't you just write a mockup of your application in a browser, or make some screenshot walkthroughs? It doesn't have to be a full-featured mockup (you're not going to get that in a browser sandbox anyway), and a walkthrough will teach people how the application works. Apr 22, 2014 at 16:16

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.