Run WinForms control inside WebForms and take screenshot of it - asp.net

Like the title says, is it possible to run a winforms component inside a asp.net website and then take a screenshot of it?

It is possible to place a user control on a web page but my experience with it in the past were really bad.
I tried this back in 2005 and it worked on Internet Explorer only, and even in a well-defined intranet there were machines where it failed.
So I would vote against.
For the screenshot part, please see this SO posting.

Short answer: no. The ASP.NET runtime won't let you create a Form within its sandbox. Access to the Graphics library is also tied to WinForms, so I doubt that will be much help.
I would take a look at WPF; the XAML markups for layout of controls can be rendered in a forms app or a web browser, allowing you to create a web control that looks like a windows form control.

Related

Create a Phone Application base on an Asp webApplication

I have to develop a phone application on every platform so I thought of using phonegap. Seems pretty nice.
I have a web application coded in classic Asp and it's this webApplication that I need to strip down to be a phone app.
At first I thought it will be simple, my classic Asp render some html so phonegap is able to put it as an app.
But it's not that simple, because in my asp I have some code that is rendered server side, I've talked to some who tell me that some html could call the asp pages and this html could be used in phonegap. Don't think it's possible ...
Well if someone could help me here, maybe i've said something wrong in my little text don't hesitate to correct me :)
My solution (I think) : code some webServices in asp.net that will use the same database as my asp classic web application. And some html and jquery will call the webservices and those html and jquery will go trough phoneGap
What is the best way to transfer and asp classic web app to a multiplatform phone app ?
EDIT : After looking everywhere, effectively phonegap can't use asp pages. So I'm questionning myself should I do a mobile website or a mobile app with webservices?
EDIT 2: I'm going for an asp.net mobile website, someone have a great way to do this, I've seen the answer proposing mvc... more details?
You are on the correct path in wanting to use PhoneGap to create a multi-platform phone app via HTML5, and some mobile framework like jQuery Mobile.
Yes, you can leverage the power of ASP.NET to serve up your data but I wouldn't create an asmx web service. A SOAP-based service serving up XML may be too fat/overkill for your mobile web app. Instead, you may want to investigate using JSON which is more lightweight (remember, bandwidth is a concern with mobile apps). One can rapidly create an API to serve up your JSON data via the new ASP.NET Web API. With your API exposed, you can make an ajax call from your html page to retrieve the JSON and bind it using jQuery.
The bonus to using the ASP.NET Web API would be when it's time to upgrade that classic ASP web site you have there, you could leverage the API you already created.
I'd really consider rewriting the website using Mvc.Net. You may want to consider using the iUI for the views.
It will be much cheaper long-term to use modern technology than trying to shoe-horn legacy code into new usage areas.
It looks like you've made up your mind to go with a webapp instead of native apps via PhoneGap. I would recommend that you pick up this book by Jonathan Stark. It's very short - shorter than it should be when it gets into using PhoneGap - and although it focuses on iPhone development, much of the content is applicable to most mobile devices. The first few chapters give a great introduction on developing attractive, responsive, highly usable web apps for mobile devices. If you familiarize yourself with jQuery and jQTouch you can get some really great looking apps with relatively little effort, regardless of the server side technology you go with.
So i'm questionning myself should I do a mobile website or a mobile app with webservices ?
The answer to that question is always mobile website... given an outdated website that the client is wanting duplicate functionality in an app.
Do the work to convert the website or at least the portions that you need to use ajax and webservices. Once you have that in place pulling the same data to place in a mobile app will be easy... you've already done it once.
So my approach would be to convert this dataview into two separate elements Data and View.
You can probably even keep the current asp pages without a lot of modification to the code since you can still call these web-service functions the same way as before in your asp code.
Well, if you really want to reuse your existing webpage you can do the following.
Create a index.html and the body.onload event, redirect to your webpage.
Then build this index.html with phonegapbuild, and you will get your "native" application that simply loads your existing webpage.
If you want to serve mobile users, you have 2 main options:
Create a mobile website. You can render html on the server all you want, no javascript programming needed. Maybe look into jQuery mobile, it can be a cheap and easy way to make the website better for mobile users.
Create a html web app (and package it inside PhoneGap if you want). This is basically a html page which loads just the data from the server in json format and updates the page contents dynamically with javascript. You need good js skills to implement this, you're server is just a REST api that server json - technology can be anything, at least asp.net mvc makes it easy. On the client side you'll want to use some good structuring frameworks, backbone.js ( http://documentcloud.github.com/backbone/ ) is a good option. Check out http://m.linkedin.com for an example of what a mobile web app can be.
3rd hidden option: just create a native app for each platform, that'll get you the best user experience.

video conference in asp.net application

I want to develop a web application (asp.net) to make interviews through video conference. So I need to find a control that could be embedded into the webform.
Do you know any control that allows this functionality and also allows to save the video/audio?
Thanks in advance.
Does it need to be a web application? check out this project someone created. Seems like it will get you going in the right direction.
http://www.codeproject.com/KB/IP/Video_Voice_Conferencing.aspx

Silverlight or ASP.NET or both?

At the moment I am starting to learn Silverlight. I have expriences in ASP.NET and like the concepts of "Masterpages. Does Silverlight provides a similar concept ? I have read a little bit about the Silverlight Navigation Framework. Is this a good replacement for "Masterpages" ?
Makes it sense to combine ASP.NET and HTML (with Javascript) with Silverlight or is it more recommandable to design and write pure Silverlight applications ? Mybe in the ner future I will start to develop an intranet (business) application which will have many and complex user interaction (it should behave like a windows client applicion). I think Silverlight is the better choice than ASP.NET !? Makes it sense also to start to use/learn the WCF RIA Services immediatly ?
Are there good (VS) templates to start with Silverlight or which are a good basis / starting point for a new Silverlight application ? Unfortunately I am missing "Starter kits" on http://www.silverlight.net like the starter kits on www.asp.net !
Thanks in advance for your hints.
Silverlight and ASP.Net are light years apart technology wise, Silverlight is closer to Winforms programming than it is to ASP.net, event though it can be hosted inside an ASP.Net page.
To achieve "masterpage" type functionality, you can have a base control or page that you can inherit everything else from. Or you can have a page which acts as a shell and you can swap views in and out depending on the user's actions.
If you are writing an app from scratch, you can do the whole thing in silverlight. You can navigate from one silverlight control (hosted in an aspx page) to another aspx page (with silverlight controls in it), but there is a performance overhead when transitioning between aspx pages (they are web pages and need to be served). You should look to eliminate separate aspx pages if possible, and create it as one big silverlight application - if your application's functionality is all rolled into one application (not spread amongst aspx pages) then you can make the most of Silverlight's Out Of Browser feature.
However you should only consider silverlight if you are build web apps or interactive/streaming stuff. If your pages are going to be largely static (i.e. presenting product catalogs, or a site where the user just drills through from one page to another) then using silverlight would be overkill, you would be better off sticking with ASP.Net or ASP.Net MVC.
Masterpages does Silverlight provide a similar concept ?
Not directly but it does provide a variety of ways to acheive the goals of Masterpages. The navigation framework is mostly the sort of thing you would need to achieve the typical reason to use Masterpages.
However its also possible to achieve "masterpage" functionality more generally by creating a UserControl that has ContentControl instances at points where in ASP.NET masterpages you would have used a asp:contentplaceholder. These content controls would be bound to custom properties added to the UserControl. This completed UserControl can then be used as the "LayoutRoot" of another UserControl or Page. Note this does not require inheritence from the "master".
Does a combined ASP.NET and Silverlight app make sense?
Well thats a tricky one the answer really is, "It depends". There are way to many factors to give this a true answer. Factors:-
Is this a public app or an internal app?
How important are including rich UI features?
First time Silverlight dev will cost you, is your project able to absorbe that?
What client platforms do you need to support?
How might ASP.NET-MVC + appropriate use of JQuery size up against your requirements?
Probably others I haven't thought of yet
Is Silverlight is the better choice than ASP.NET when there are many and complex user interactions?
The phrase "complex user interactions" could mean a couple of things? Do mean complex to deliver with HTML and Javascript but simple for the user? Or is this a sophisticated app aimed at an expert user?
In either case its likely that Silverlight will start to come into its own here.
Does make it sense also to start to use/learn the WCF RIA Services immediately?
Yet again the answer depends of the type of application you have in mind. If its line of business app where data is searched, edited and reported on then (assuming you have decided to develop in Silverlight at all) definitely you should be looking at WCF RIA Services as well as the parts of PRISM that think are appropriate.
Other types of apps may not benefit from WCF RIA Services.
Are there good (VS) templates to start with Silverlight or which are a good basis / starting point for a new Silverlight application ?
There are no start kits at present. However I think you will find what you need amoung the various demos and tutorials on the silverlight learning site.
I've particular found the videos useful. If you decide to go Silverlight its well worth clearing a day or two to got through the relevent ones.
These are a lot of questions at once.
Yes, the Navigation Framework functionality is pretty much equivalent to the Master Pages concept. Even to the point that it is tracked in the URL when users navigate, so they can use the back and forward button of their browsers.
If you want to do a stand-alone Silverlight application or a hybrid pretty much depends on your requirements and on the type of application you want to develop. If it's a Line of Business application, you might be doing fine with Silverlight alone.
For a public, content/text-intensive website probably HTML with some silverlight gadgetry here and there might still be preferable.

ASP.NET: does it involve Active X at all?

Sorry, really newbie question, but if I was to create an ASP.NET website application, such as a calendar of events linked to a database - would the user interacting with this Calendar be using Active X?
Don't really know how to put that question any other way. Reason I ask is that my works system blocks Active X controls and therefore there would be no point in using ASP.NET to develop anything.
As a side question - What doesn't use Active X?
Thanks
ASP.NET is a server side technology and does not necessarily have anything to do with client side technologies such as ActiveX or anything else.
ASP.NET doesn't use ActiveX unless you make it do so, via interop.
There are many ASP.NET controls etc that will do what you want and use JavaScript etc rather than ActiveX. For really slick dynamic stuff MS are pushing Silverlight, which is their competitor to Flash in many ways.

Is InfoPath the right choice?

Ok so we have an upcoming development that will involve a level of off line processing of dynamic forms. Here's what we have to do:
Create a asp.net web application whereby users can download dynamic forms, fill them in then upload them to be published.
We also have a windows mobile application that will do something similar.
The forms will requires images to be selected for uploading when publishing.
Upon publishing the completed form certain server side validation needs to occur which may trigger additional work to be done i.e. send out emails or update a database etc.
From what I know of InfoPoint (which is next to nothing) it seems like it may be a nice fit. I know its quite highly tied to SharePoint (which again I know nothing about), but can it be used without a SharePoint instance?
Either way, I am just firstly looking for validation that InfoPath is a good fit for what I describe. If it is the I am also after some good online resources.
Thanks in advance, Chris.
I don't think that there is an InfoPath client for mobile devices. What you would want to do is use Forms Server (comes with SharePoint 2007 Enterprise edition) to render InfoPath forms as aspx to the mobile device.
Everything else you describe could be done with straight ASP.NET and the InfoPath client. The mobile piece sounds like it will require SharePoint (for rendering the InfoPath forms as aspx).
See this blog post on using Infopath forms on mobile devices: http://blogs.technet.com/vik/archive/2008/02/25/filling-out-infopath-forms-on-windows-mobile-devices.aspx
Also the Formotus solution may work for you: http://www.formotus.com/
Before delving into whether or not InfoPath (+ SharePoint) is the right solution, what's the reason for not using ASP.NET with which I assume you are familiar? While InfoPath + SharePoint is sexy and hot right now, the learning curve is very high.
Back to InfoPath, I don't believe InfoPath supports uploading files. At least not out of the box. So if having your users upload images is a requirement, I'll say infoPath is out. Apart from that, InfoPath, with the addition of SharePoint Forms Services and workflow, can be used to accomplish what you want. I just wonder what the cost would be versus using straight up ASP.NET.

Resources