Click here to Skip to main content
15,903,388 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I have created one Windows Form User Control and I need to put it in a Web page, for that i using <object> in web form to open the windows form control in web page.

What I have tried:

what i have done is create a windows form user control, take the dll and paste it in the root of the web application project. then load the web application, its not showing the user control which i have created in windows form, just show a frame i  the internet explorer.




this is my windows form control..

<pre>[ComVisible(true)]
    public partial class UsercontrolTest : UserControl
    {
        private System.ComponentModel.Container components = null;
        public UsercontrolTest()
        {
            InitializeComponent();
        }
    } 



aspx page..

< html xmlns="http://www.w3.org/1999/xhtml" >
< head runat="server" >
    < title >Web host< /title >
    < script type="text/javascript" >
        function showmessage() {
            debugger;
            var winctrl = document.getElementById("DicomT");
            winctrl.innerHTML("Message sent from the HTML page!!"); 
        }
    < /script >
< /head >
< body >
    < form id="form1" runat="server" >
    < div >
     < h1 >Windows form control< /h1 >
     < object id="DicomT" height="300" width="500" classid="http://localhost/Testhost.dll#Testhost.UsercontrolTest" >
     < /object >
     < br/ >
     < asp:Literal ID="Literal1" runat="server" >< /asp:Literal >
     < br/ >
     < input type="button" onclick="showmessage()" value="Send Message"/ >
    < /div >
    < /form >
< /body >
< /html >



can anyone help me , its quite urgent.


Thanks in advacnce...
Posted
Updated 4-Feb-18 20:14pm
v2

1 solution

I hope your query will be solved below link.


[using-a-windows-application-on-the-web]
 
Share this answer
 
v2
Comments
Member 13399355 5-Feb-18 3:32am    
Ok i have checked the above solution, but i have a query about the process no. 8..
is that we renaming the exe generated from the build of the windows application??
process 10 and 11 are also confusing..

could you please check ??
Arunprasath Natarajan 5-Feb-18 23:15pm    
Point No 10
You can run a command-line tool called the Assembly Registration Tool (Regasm.exe) to register or unregister an assembly for use with COM. Regasm.exe adds information about the class to the system registry so COM clients can use the .NET Framework class transparently.

Point No 11
Using the Global Assembly Cache tool (Gacutil.exe). ... Gacutil.exe is only for development purposes and should not be used to install production assemblies into the global assembly cache.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900