Can ASP.NET Page use WPF Controls? - c#

I was wondering if ASPX page can use WPF Controls (from the toolbox in the designer)?
Because I have a custom user control that I made for a application before but now i am creating a web app. In the web app the controls were grayed out.
I was wondering if there is a way to use the user control in the web app?

Unfortunately, you'll have to create a new ASP.Net control that mimics your WPF control. The two technologies have completely different approaches to rendering (DirectX primitives vs. HTML), events (Routed events vs. Postbacks), etc. and are simply not compatible.
That being said, converting a WPF control to a Silverlight control is doable, and would allow you to leverage your previous work. You would still need to run it through a Silverlight app, though, rather than directly through the ASPX page.

ASP.NET is primarily a server side framework and WPF applications run on the client, therefore they don't really work well together. You might find it easier to convert the WPF control into a Silverlight control instead and pass that through your ASP.NET page. Users will need a Silverlight plugin to run it.
These two posts might help in the conversion:
Porting from WPF to Silverlight: The Missing Pieces, Part 1
Porting from WPF to Silverlight: The Missing Pieces, Part 2

Related

Create multi-view control in windows form

When using ASP.NET I was often using MultiViews,Is there a control that can be used in a C# Windows Forms Applications like MultiView, I try Tab control can help to do that but if any other control to make multi-view without using Tab control
There is no controls "from box", that you need. I can recommendate to you use WPF technology, if it's possible by your business requirement. WPF contains feature like Data templates selector, which can solve your problem.
I ran into this same problem and just implemented my own, using Panels

connect vcsharp windows form application with asp.net

kindly tell if there is any way to solve the connectivity of the vcsharp with asp.net. as i am trying to run the c# windows form application on asp.net to make my website more knowlodge able. Is there any other connevtivity option besides aspnet.
You can run web application in windows Forms application. You may embed the WebBrowser control. It makes sense, but if you want to run desktop application in a asp.net web this doesn't make sense IMO.
If you want to benefit from Rich Controls behaviors, you have web widget available within jQuery UI, BootStrap, etc.
Don't mix things
EDITS: According to your first comment, I'd suggest you to search for the web sdk for arcgis or an equivalent. Or You may need to reference dll available in the SDK and use web controls to display data
Plz read this

Silverlight / WPF communication

I have a WebBrowser control showing a Silverlight application. This control is in a WPF application. Obviously this is a bit of a hack to integrate Silverlight with WPF as ultimately neither one knows about each other, they're completely independent.
So what I need is for Silverlight to post a value into the WPF application. What I was thinking was using JavaScript hosted in the .aspx page in the Silverlight application which can be accessed from both Silverlight and WPF. I think it is fairly simple getting data from Silverlight to the .aspx page but I'm not sure how to get the data from the .aspx page to WPF. Ideally I don't want WPF to have to call for the data, I want it to be posted from Silverlight and appear in the WPF application without WPF having to do anything except receive and display the data.
Hmm...hope that makes sense.
Silverlight to/from JavaScript: see here
MSDN - Making Silverlight Scriptable by JavaScript
WPF to/from JavaScript: see here
Stack Overflow - Invoke C# code from JavaScript in a Document in a WebBrowser
Code project - Working with webbrowser in wpf

Want to run WPF application on Asp.net web application.

I want to run my WPF application on asp.net web application. Actually I have a WPF page.xaml which contain the image viewer, which actually open image and edit it as required.
Now I want to embed that in my Asp.net Web application. I have a asp.net web application user control on which I want that WPF stuff. I research on it on the internet, I find a way that we first publish the WPF application on the IIS server and then past the URL in asp.net web application page iframe. as I follow this below link:
http://msdn.microsoft.com/en-us/library/aa970060.aspx#deploying_a_xbap
now I not want to follow this approach. I want an alternate way of this. Is there any way to handle this scenario. If yes then how can we achieve this?
Yes there's a better way: you can use Silverlight (basically it's a C# equivalent to Flash).
Even if Silverlight is quite the same as WPF, there is some differences due to the fact that silverlight is made for web. So you'll have to make some changes to your application.
About integrating it in your page, it seems quite simple:
You can use an object html element (as you would do with Flash)
Here are some links about that:
http://msdn.microsoft.com/fr-fr/library/cc838145(v=vs.95).aspx
http://www.c-sharpcorner.com/uploadfile/raj1979/host-silverlight-in-Asp-Net/
2 years later, a possible answer appears! Maybe someone else will see this and get some use out of it.
I have been hearing rumors that it is possible to run your WPF application in a browser, it's called an XBAP?
https://msdn.microsoft.com/en-us/library/aa970060%28v=vs.110%29.aspx
I am about to give this a try myself, I'll update this answer with any limitations I find.

How to skin UI using Forms?

I'd like to know if is there a way to "skin" a Form and every widget used inside it. Images should be on background and other elements shall be setup accordingly.
In short, a way to implement a way to display the same Form in different flavors (i.e.: theme and eyecandy UI).
DevExpress makes a WinForms control suite with an excellent selection of skins.
Telerik also provides WinForms components with theme support. I've used their library and it works fine.

Categories