Question

I'm looking for a framework which allows me to manage my application through a webbased GUI (using an embedded webserver) instead of winforms.

Something like this: http://www.webtoolkit.eu/wt but then for .NET

In my code I should be able to instantiate classes (like buttons, forms etc), and when a user browses to a given port, the app should render it as javascript/ajax etc etc. preferably, when buttons are pushed, a notification in my code should be called.

this is a less specific question than another one I posted about extjs. I hope this will attract more viewers since it is more generic

Thanks.


Update:

cassini like solutions don't fit the bill. Since the webbrowser is embedded in my application, there is no need for ASP.NET server side scripts. I would rather have the framework, call functions inside my application when things happen on the page. onButtonClicked() for instance.

Was it helpful?

Solution

How about embedding Cassinni and using ASP.NET?

OTHER TIPS

You might use the System.Net.HttpListener class as an embedded webserver. The HttpListener will do the low-level stuff for you, but you will have to write the code that returns the Html/javascript/images yourself.

I tried it out just for fun myself, embedding firefox using GeckoFx against a web server embedded in the application itself. It seemed to work well, but my test was very simple and limited.

You can host the ASP.NET runtime in your own application and use any web UI framework like LiveUI or something like this. See how to do this here.

If you could use ASP.NET (using development server or cassini) then your task would be simpler. I strongly recommend this approach. In this case you could use liveui, componentart or teleric. liveui provides Extjs based framework to implement 3-tiered web applications. componentart and teleric provide nice ASP.net controls.

Whereas webui probably can work as httpHandler without ASP.net infrastructure. But I would not recommend to use webui because 1 potential performance problems 2 complex and not flexible programming model.

Are you limited to what framework your application can support? If you can use .NET 3.0+, The Windows Presentation Foundation can be used to target both web (via xbapp or silverlight) and traditional windows form applications.

As far as communication between apps goes, this is where the Windows Communication Foundation (WCF) really shines.

Just to clarify, you could use Casini host your web app and use the WCF to communicate between it and your application, or use xaml to markup your application and expose it as both a web application and a normal windows application with the same UI.

If you want to automagically convert running WinForms code to HTML, you're already in deep water. I have done something similar with Visual WebGui, but it does require modifying your code and will basically generate an ASP.NET application for you -- needing an actual web server to run it.

I see you don't like the Cassini option -- if you also expect this to work without a web server, then I think the quick answer is "no way".

If you have a relatively simple interface, I think your best bet is probably to generate the HTML code dynamically, either from your existing forms or from scratch, and go with System.Net.HttpListener.

I did a long time ago, a .NET 2.0 project which basically had a Webbrowser control.
I would feed the WebBrowser control with html through it's Document properties, and would listen to the navigate event, in order to grab the Html from my resource (or build it instantly) and feed it again to the WebBrowser control.

Now the fun starts with the ObjectForScripting property. This allows your html page to talk to a .NET object through Javascript like: window.external.SomeNetFunction(bla).
Don't forget to add the ComVisible attribute to the class that is used in ObjectForScripting.

I hope this is what you are looking for. In this solution you have a webpage which can navigate, and also via javascript can talk with your app. (like this you can come close to a .NET version of AIR...)

DevExpress have a product that does what you require. You'll have to fork out for it though...

http://www.devexpress.com/Products/NET/Application_Framework/

I would suggest going the Linux route instead and rely on something like an embedded httpd, boa, or similar to keep size down. Running Windows is not recommended on embedded systems, too much bloat and too many security holes. Better go with Linux or an RTOS.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top