Can a Web Forms Control be Used in a Desktop App?

G

Greg

Can a Web Forms Control be Used in a Desktop App?
Can it even be used on a Windows Form?

Are there any special needs on the desktop for running Web Forms e.g. is IIS
needed, or as long as client system has .NET Framework a Web Forms app will
run on it?
 
S

Steve C. Orr [MVP, MCSD]

The short answer is No. A web forms control cannot be used directly in a
desktop app.
The long answer starts with "anything is possible given enough time and
resources..." but I wouldn't consider it very feasible.
Of course the web browser control can be used to embed web pages in a
windows forms application, but I probably wouldn't try to use it for
displaying a single control. In short, if you want to use web controls
you're better off creating web applications.

It's a little bit easier to do things the other way around and use a windows
forms control within a web application, as demonstrated here:
http://SteveOrr.net/articles/WinformControls.aspx
 
R

Richard Purchas

Sure. Host the browser in the ActiveX container that comes with Internet
Explorer; interaction with your desktop app is cumbersome but can be done.
i.e. you could pass data through a hidden frame/iframe, and have your app
respond to 'change' events fired by the ActiveX control. Your app can then
inpect the hidden data etc.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top