.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Hosting a Windows Form Control in a web page

Posted By:      Posted Date: October 13, 2010    Points: 0   Category :ASP.Net



I have created one windows ( user control dll ) application  and try to use in Browser using following code.But I'm not able to view the windows application ( Windows application UI)  in browser.Please let me know how to resolve this.



<object id="MyWinControl" classid="http:WindowsControlLibrary1.dll#WindowsControlLibrary1.UserControl1"                      height="100" width="300" VIEWASTEXT/> 






View Complete Post

More Related Resource Links

Problem hosting a WPF user control in a windows form application

I have a windows forms application and want to to use WPF inside this application. So I have add a WPF user control into my project. Then I take a ElementHost from the toolbox and put it on my windows forms. The problem is now, when I want to add the WPF control with "Edit Host Content" I get the message "This ElementHost is currently not hosting any editable content....." What's wrong? How can I embed my implemented WPF control into the ElementHost ?

windows form control library error in asp.net

Can some tell me what is this problem?my windows form control library have the drag and drop.when i open in web, the below error pop out.

How to enable own shortcut within WebBrowser control in Windows form application




I am developing a windows form application with C#, where I have placed WebBrowser control... I load some web page in this webbrowser and I need to know, that after I press my own certain shortcut that it will allow me to call my handler...

It should work something like this => I have certain textbox on web page and after pressing my own shortcut, it will call my handler which will automatically type certain text (which will be prepared in that handler) into that textbox... 

Could you advice me, how to make this happen or if it is even possible?


Thanks a lot in advance

How to pass value from browser into embedded windows form control library


Hi all,

i have one project which i embed the windows form control library inside the web form.

now i wanna pass a url from aspx into my windows form control library.

May i know how to do this?


windows form control library unable to view in client pc


Hi all,

i have another problem regarding the windows form control library.

recently i test the program in my own pc, the windows form control is running.

but when i try access my project in local network client pc, the windows form control doesn't show.

it just an empty.

may i know what is the problem?

My project is embedded the windows form control in aspx.

i got the cache in client pc, the windows form dll have inside the cache and also the client pc have .net framework install.

in my own pc, i also disable my firewall.

the result still same, the control cannot show on client pc.

Anyone can help me?


How To : Add a ListBox Win form control to a asp.net .aspx page


Here is my requirement:

Do File upload without fileupload asp.net control, instead do following:

1) 'drag and drop' of file (attachment) from windows explorer to .aspx page

2) 'Copy / Paste'  - in a .aspx

What I can think of is doing it by creating a 'Windows ListBox control'.dll and calling it in aspx page with


Is there any better solution out there?

Unbound .NET WebBrowser control deactivates Windows Form


In a project of mine, I need to work with unbound WebBrowser controls. The goal is to navigate simultaneously to several web pages, using several WebBrowser controls, and showing the individual pages when the user requests them pressing a button, binding the needed WebBrowser control to a container control in the form to display them.

Problem: Whenever one of the WebBrowser controls loads a page that focuses a control on the page by means of scripting, my Form gets deactivated after document complete if the WebBrowser control is not showing. This only happens with pages that focus an element on load (for example, using onload attribute in body tag but not only).

Reproduce code (using www.msn.com since this site focusses the search textbox after document complete):

In a standard new VB Windows Forms Application (with Form1), drop a button (Button1) in the Form1 designer and this code in the code editor:
Public Class Form1

    Private wb As New WebBrowser

    Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click


    End Sub
End Class

Expected result from running the Application and pressing Button1:
The unbound and invisible WebBrowser control loads the msn page, the form Form1 stays activated.

Some Controls like master Page in Windows Form application???

hi , i have a form , panel , tool bar and search text Box , and i want to make them like a master page ( its not asp.net projects ) its windowsform application , when user clik to some thing the the contetnplace holder change but the master page content dont change .
 its possible?

example ur web browser , at the top u see tool bars , navigation bar ,,,, etc , and down u see web page , how ?

How can I create a custom control that adds other controls visible to the page hosting my custom con


I want to create a custom control where I define several specifically named DIV sections.  The code-behind logic of the custom control will perform operations on these named DIV sections.  The page where the custom control is hosted needs to be able to add named controls to the DIV sections and perform operations on these named controls added to the DIV sections.

Let me explain a little further.  In the custom control, I want to have code behind logic that fires the following Page Event and uses a condition to make one or another specifically named DIV section visible or not:

    < _
    ToolboxData("<{0}:BaseDetails runat=""server""></{0}:BaseDetails>") _
    > _
    Public Class BaseDetails
        Inherits UserControl

        Protected Sub Page_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreRender
            DetailsNameDiv1.Visible = False
            DetailsNameDiv2.Visible = False

Datagridview control vb.net Windows Form

I want to detect the keystroke or keycode for the "Arrow Up" Or "Arrow Down" in the Datagridview "Selection Changed" event on a vb.net Windows form. Just to want to put a "If" statement to do some stuff if it is true that the keypressargs is either "Arrow Up" or "Arrow Down". Thanks

Create single custom login page for Windows Authentication and Form Based Authentication.


I want to create a custom login page for both Windows Authentication and Form Based Authentication.

I mean to I have to create only single login page for both authentication.

How can I create this kind of page?

G. Goyal

Windows form VB.net tab control

In a VB.net Windows form, it has a tab control with several tab pages. One of the tab page it has a groupbox with several radio buttons in it. The tag of the groupbox is binded to a dataset field. On the tab control "Selecting" event  to select that tab page, it refreshes the binding dataset and after to check the radio button using the tag value binded to the groupbox. It never works in terms of checking off the radio button the very first time when selecting that tab page and it will work in checking off the radio button after. Don't understand why and how this happens?

Setting the default start page in godaddy hosting?


 How do you set the start page with godaddy hosting? I can see no way of doing this! You do not seem to have access to the IIS settings that allow you to change it!

Building Re-Usable ASP.NET User Control and Page Libraries with VS 2008


I am having problems with a user control. I want my solution to have a separate project for holding my user controls.

The main project can get a reference to this user control project and can import this user control dll into my main project. 

Thanks in advance,

Dheeraj Mittal


How to position one control relative to another one even after resizing windows?


I used following Jquery code trying to make image close to a table. It worked fine after first load, but the position changed after window is resized. Any ideas? thanks

$(document).ready(function() {
            var pos = $("#mytable").offset();
            var width = $("#mytable").width();
            var left = pos.left + width + 20;
            var top = pos.top + 200;
                position: 'absolute',
                zIndex: 5000,
                left: left,
                top: top

Content page control passes as argument to javascript function


Here is the content page:


<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="JavaDynamicCopyValue.aspx.cs" Inherits="JavaDynamicCopyValue" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
 <script type="text/javascript" >
 function copyValue(input, output )
   ouput.value = input.value;
   return true;
 <asp:TextBox ID="txt1" runat="server" onchange="copyValue(this,document.getElementById('<%=txt2.ClientID%>'))"></asp:TextBox>
    <br />
    <br />
    <asp:TextBox ID="txt2" runat="server"></asp:TextBox>


I got a javascript run time error says output is undefined. if I view source of the page, the txt1 markup became:

<input name="ctl00$ContentPlaceHol

Visual Studio closes itself by opening aspx-Page designer after Windows Update


Hey Guys,

I've a problem with my Visual Studio.

On the 13th of August 2010 i installed a Windows update on my vista sp2 pc. For this date my Visual Studio 2008 sp 1 always has closed itself by opening an aspx-page in designer view. There is no error message just closing the window. I restored a backup of my windows from the time before updating it and it helped, i could open aspx pages in the design view till the update has been installed again automatically after rebooting the pc. I can't disable windows updates, cause it's my pc at work and safety is very important. I hope you could help me out of this disaster.



ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend