How to add a winforms usercontrol in an aspx page - asp.net

How can we add a winforms user control in an aspx page?
Any help will be appreciated.

Take a look at an article from ASP.NET.4guysFrom - Hosting a Windows Control in a Web Form and also Hosting .NET Windows Forms Controls in IE

You can't, as far as I'm aware. If you want a native client style experience in a web app (and AJAX isn't good enough for you), you should look at using SilverLight.

its possible to embebed but user will need to download the assembly and executed locally
http://weblogs.asp.net/spano/archive/2007/09/19/hosting-a-windows-form-control-in-a-web-page.aspx

Related

Routing in ASP.NET Web Forms Website

I am trying to implement routing mechanism into my ASP.NET Web Forms - Site. Unfortunately all tutorials on how to do it I can find describe ASP.NET Web Forms - Application scenario, with Global.asax file. I obviously do not have this file. What are my options?
Click the show all files icon on top of Solution Explorer and you should be able to see it.
you should look into the MVC design patten.

How can I manage a WinForms .NET component from ASP.NET?

I have a WinForms .NET component that can render and save JPG images. How can I make it work on my ASP.NET website each time a visitor requests a page?
Do I need write a web service?
Do I need to run a winforms app on the server and interact with it?
Do I need to host it on a separate ASP.NET page and query it to render and save new images?
Thanks.
EDIT: I am looking for a solution that doesn't need any control to be downloaded but simply a page refresh to display the new image.
Simple way to expose a .NET WinForm control as an ActiveX control in any HTML or aspx page
http://www.codeproject.com/KB/miscctrl/htmlwincontrol.aspx

Creating Xaml control in (aspx)web application

Is it possible to create a .xaml (silverlight) control in a web application project?
I have an aspx application wherein I am using ajax controls and updatepanel. I want to create some silverlight controls in the same project, and load it along with my other pages/controls.
I am not sure if it is possible to create a silverlight control without having a dedicated silverlight project template.
I think your question is the same as one of mine: Is there a way to insert Silverlight XAML into my page using ASP.NET code-behind?
If so, the answer is basically "not in any sane way, but you can hack it by setting up different parameters (as in weiqure's answer) and using them to dynamically generate the XAML."
I'm not sure if this answers your question, but you can have a solution file that contains your web app and a Silverlight control. Then, to include the control in your web app, add it via the "Silverlight Applications" tab in the web app's project configuration. This will auto-update the .xap file in the web app's ClientBin folder.
Alternatively, you can create the Silverlight control in its own project/solution outside of the web app solution. Then you just need to copy in the .xap file to the web app's ClientBin and add it to your aspx page the usual way. I've found this approach useful when I want to deploy the same control to multiple web sites/projects.
Instead of creating several controls you might try creating one control that dynamically creates it's own content.
You can tell the control what to do by passing initialization parameters to it. Here's the MSDN tutorial and here's a blog post about it.
I think this approach is no worse than creating controls dynamically. You can probably send it XAML markup (I'm not sure if I remember that correctly, though), otherwise you could path something like "myButton=Type:System.Windows.Controls.Button;Content=Click me!" and then use reflection.

Sending asynchronous request on clicking a sharepoint web part button control

I am new to this whole sharepoint and aspx programming. I have developed a sharepoint web part that has a button control. The onclick event is mapped to a method in my web part code. When I click the button the whole page reloads and the web part is rendered again. Is there a way to prevent this reloading of the page? Is there a way to call the function method in the background? Something similar to AJAX.
Thanks,
Jagannath
You can use Ajax, it just requires some sharepoint configuration. Here are a few posts to get you started:
http://weblogs.asp.net/jan/archive/2007/02/26/using-the-ajax-control-toolkit-in-sharepoint.aspx
http://sharepoint.microsoft.com/blogs/mike/Lists/Posts/Post.aspx?ID=3
Ajax or SilverLight are your only two options for Async operations without a page refresh.
Once you know the tricks needed to get SharePoint and ASP.NET AJAX to work together it's not that difficult.
Here are the steps required:
Ensure the ASP.NET AJAX Extensions are installed on all the front-end web servers (this is not required if you are using .NET 3.5 as the Extensions are included in the Framework)
Update the Web.config file for the SharePoint Application to support ASP.NET AJAX
Ensure any page that is going to use AJAX has a ScriptManager
Use an UpdatePanel or a client-side service call to get updated data and re-render the Web Part
This blog post has some resources from a talk I did on the subject at TechEd Barcelona 2008. These resources should give you the information you need to get started.
http://msmvps.com/blogs/windsor/archive/2008/11/13/teched-emea-resources-and-demos-integrating-asp-net-ajax-with-sharepoint-2007.aspx

ASP.NET Ajax feature in existing ASP.NET website

I have a ASP.NET Website which was developed in ASP.NET 2.0.
Now I want to add a new page to the project which will make use of the ASP.NET AJAX features like Partial page updating.
Is there any options to do this ? Do i need to change any settings for this in my already existing project /Solution ?
The only problems you may run across is inside you web.config file if you don't go in and register the asp.net ajax assemblies.
Other than that you should be able to add a scriptmanager control and work with the page like any other asp.net ajax page.
Edit: Here is some documentation that should help you configure ASP.NET AJAX to an existing website.
http://www.asp.net/AJAX/documentation/live/ConfiguringASPNETAJAX.aspx
There is a great tutorial about how to implement AJAX on a regular ASP.NET web site.
http://www.asp.net/learn/ajax-videos/video-81.aspx
Hth...

Resources