473,387 Members | 1,791 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

How to create Activex Control using C# and Use it in ASP.NET webform?

Hello

I would like to create Activex Control uisng C# and use it in ASP.Net webform. User Control is not solving my requirement so I am going for Activex Control.

Please guide me on this, how to do it, if any sample is provided will be of great help

Thanks
EJ
Nov 18 '05 #1
3 22823
Hi E J,

From your description, you're wanting to create an ActiveX control via C#
and use it in ASP.NET web page, yes?

As for the question, here are some of my suggestions:
1. Since C# is a dotnet based language, it only support building managed
component or control(.net code). And there is not buildin means for
developing COM or ActiveX COMPONENT directly in .net(C# or VB.NET). I think
we still need to use C++ or VB(I recommend this since it'll save us a lot
of time) to develop COM or ACTIVEX compoents or controls.

2. There is one feature called Interop in .net which help to expose
COM/ActiveX components to dotnet or expose .net components/control to COM
interfaces. So there is means that we develop an .net winform control and
expose it as an ACTIVEX control and use it. The following tech article has
dicussed on this:

#Simple way to expose a .NET WinForm control as an ActiveX control in any
HTML page
http://www.codeproject.com/cs/miscct...wincontrol.asp

3. As #2 has mentioned that we can expose a .net Winform control as activeX
and use in web page. However, the .net has provide another nice feature
----------IE host Winform controls--------- which can directly help use
Winform control in IE. I recommend that you have a look at this means. And
here are some certain

#Using Windows Forms Controls in Internet Explorer
http://samples.gotdotnet.com/quickst...eSourcing.aspx

#Host Secure, Lightweight Client-Side Controls in Microsoft Internet
Explorer
http://msdn.microsoft.com/msdnmag/is...l/default.aspx

#Embedded Windows User Controls into Internet Explorer
http://www.devhood.com/tutorials/tut...l_id=187&print
er=t

http://msdn.microsoft.com/msdnmag/is...h/default.aspx

Hope helps. Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx

Nov 18 '05 #2
HI Steven

Thanks for the valuable suggestions

I tried using Winform User Control in ASP.Net webform, but I am having trouble using it. When a winform User Control contains WebBrowser control in it, the user control is not getting displayed. Just blank text box kind of control is getting displayed depending upon the specified size and width.

The properties in IIS for the hosted control site is set to Execute Sctipt . Any other settings is required for this to be run

Thanks
Vani
Nov 18 '05 #3
Hi Ej,

I found that the problem in this issue is just caused from the one
mentioned in another thread in this newsgroup
The title is
Subject: Firing Click events and Reading IFrame Source of External URL in
ASP.NET web form

Is it right? I think your problem is not with the winform control but with
your security setting on the client machine. You need to adjust the Code
Access Seurity on the client machine so as to allow the winform control
execute in the client machine's IE host CLR enviroment. I've posted my
reply in that thread and also have send a mail and attached my demo project
and some related screen shots. I send it via the following address :
va***********@megasoft.com

If it is not correct, please feel free to let me know and I'll resend.
Also, if you feel it convenient that we continue to discuss in that thread,
please feel free to post here. Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx


Nov 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Vinay | last post by:
Hi all, Can we create an ActiveX (.OCX) control in ATL project type? Is project type for creation of .OCX file can only be ActiveX MFC type? If yes, Could you suggest me some Links? My...
0
by: VB Programmer | last post by:
I am going to use an ActiveX control on my webform. 1. How can I set it up so that if a user views the web page and doesn't have the ActiveX control it immediately/automatically downloads it...
1
by: VB Programmer | last post by:
I am going to use an ActiveX control on my webform. 1. How can I set it up so that if a user views the web page and doesn't have the ActiveX control it immediately/automatically downloads it...
1
by: Sreejumon [MVP] | last post by:
Hi, If you want to use the activex controls in your asp.net page, you ahev to use the single aprtment thread model. For that please add the "aspcompat=true" attribute the page directive. Let...
1
by: VB Programmer | last post by:
I have a webform that uses an ActiveX control. I want the user to automatically download the ActiveX control if he doesn't have it. How can I do this? Also, does it need to be registered too? ...
2
by: Wasi Rehman | last post by:
Hello friends, I am facing some problem about ActiveX Control (Build in VB 6.0) , when i add activeX control in WinForm its work fine I can access its attribute and method but when i add the...
3
by: Jeff Beem | last post by:
Hi, I'm a long-time VB/VB.net developer but this is my first web development experience. I've been tasked with hosting/rendering one of my company's ActiveX controls on an ASP.net 2.0 web page....
2
by: estufa | last post by:
Hi I see some questions about creating ActiveX controls using .NET. I found the answer in this page and it works really good for me....
5
by: =?Utf-8?B?UGF1bA==?= | last post by:
Hi I have start web form and when the user clicks a button (server.transfer) they are directed to the second webform. I was wondering if there is a way to create an instance of the first webform...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.