The next version of the application will be a .NET based application (both desktop and web). The requirement is that both applications have to look and work exactly the same way. I was thinking that maybe there was a way to create a web control or something and use it in both applications.

Is this possible?

For example can I create a user control for the web and use it for the desktop (without using a web browser control)? If the above isn't possible, what are my alternatives?

Please let me know.

4 Answers 4


Since you're using .NET anyway, you could use Silverlight which provides a fairly rich web experience and can then be run directly on the desktop (essentially bringing the web to the desktop rather than trying to take a desktop app to the web).

There's much confusion over Microsoft's long-term commitment to Silverlight at the moment, though, so it may not be the right time to be making long-term technology commitments.

Alternatively, you could go for a similar approach with HTML5 which MAY prove to have a longer life-span - but the tool/browser support isn't as well established (and it's not .NET)

Actually - that's a question: what level of cross-browser support is required for the web app. Is a client-side browser technology viable, or do you need to do everything server side?

  • It is server side code. I forgot about Silver Light. I'll be honest that may be the best way to go even with the Microsoft issue. As it could be a good bridge until HTML5 gets more mature.
    – webdad3
    Commented Aug 7, 2011 at 15:08

Note: I won't argue with your idea to have two identical UI for the desktop and web app. This is a terrible idea, and I highly suggest you to recondider it. Please create an optimized UI for each device.

The best way to have identical UI is to create your own controls or use an existing suite. There are many of them available. I personnaly use DevExpress.

They do a pretty good job at making their controls look similar on both web & winforms.

Since they use the same core components, it's pretty easy to reuse almost all your business logic.

  • Please note... Not my idea but it is the requirement...
    – webdad3
    Commented Aug 6, 2011 at 16:29
  • I guess also... When you say create your own controls. Can I create 1 user control and use it in both projects?
    – webdad3
    Commented Aug 6, 2011 at 16:30
  • @webdad3: no, just like you should do for your different UI, you will have to create different rendering for both. But you can share some core things. The best example is a charting control. In both case it's an image that is generated, but rendered differently on both web & winforms
    – user2567
    Commented Aug 6, 2011 at 16:47

The web is a different canvas than the desktop. Applications are not meant to look the same on each.

Concentrate your efforts more on code reusability through code libraries and having both applications achieve the same functionality.

If you try to make the UIs the same, you're going to have a desktop application trying to look like a web application, and a web application trying to look like a desktop application. Two thumbs down on that.

  • I agree with your statement. I will bring this up to the owner, however, it is his requirement. Are you saying that what I'm asking CAN NOT be done?
    – webdad3
    Commented Aug 6, 2011 at 16:39

I had to deal with a similar case.

You have to check which common controls from webforms & winforms can look similar. You may wanto to check if employeer allows you to buy third-party controls libraries or open source libraries, in case the integrated controls aren't enough.

  • Basically what I'm interpreting is that there is no way to write 1 piece of code for both environments. All I can do at best is make them look similar in nature.
    – webdad3
    Commented Aug 6, 2011 at 17:17
  • You may want to separate logic code from interface code, use methodologies like 3-layer, entity framework, M.V.P., M.V.C., and make interface to be different, but, logic & data access the same ;-)
    – umlcat
    Commented Aug 6, 2011 at 18:15

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.