Embbed .NET Custom Control (ActiveX) into ASP .NET page

G

Guest

Hi All,

I'm trying to display .NET Custom Control (created using Inherited Control)
on an ASPX page, but no luck. I already registered the Control to Global
Assembly Cache through .NET Framework 1.1 Configuration. I have also put a
reference to the control on my ASP .NET project. The view that I get is only
a disabled text area.

Below is the code that I'm using:

<html>
<script language="JScript">
function ChangeText() {
simpleControl1.Text = text1.value;
}
</script>
<body>
<p>Simple Control
<br>
<br>
<object id="simpleControl1"
classid="http:bin/ActiveXDotNet.dll#ActiveXDotNet.SimpleControl" height="300"
width="300" VIEWASTEXT>
<param name="Text" value="Simple Control">
</object>
<br>
<br>
<input type="text" id="text1" NAME="text1">
<input type="button" value="Change Text" onclick="ChangeText()"
ID="Button1" NAME="Button1">
</p>
</body>
</html>

Can anyone help me with the issue?

Regards,
Budhi
 
G

Guest

Hi Steve,

Thanks for the answer. It works fine now. Now I'm trying to sign my active x
control so it can execute certain program on the client's computer. The
ActiveX will be in the intranet, so there won't be any issue with public
domain. Any insight on this matter?

Regards,
Budhi
 
S

Steve C. Orr [MVP, MCSD]

If it's signed I'm pretty sure it won't work in this embedded way you are
trying.
I also want to clarify that it isn't truly an ActiveX control you are
making, it is an embedded windows forms control.
ActiveX controls are based on COM, and while they have some similarities
there are also many differences between ActiveX controls and embedded
windows forms controls.

--
I hope this helps,
Steve C. Orr
MCSD, MVP, CSM
http://SteveOrr.net
 
S

Steve C. Orr [MVP, MCSD]

I don't have time to detail all the differences, but what it boils down to
from a browser perspective is that ActiveX controls have all or nothing
permissions, while embedded windows forms controls run inside the security
context of the .NET framework and also Internet Explorer. This makes them
much safer for users and much more configurable so they can be given
permission to do only what they need to do and nothing more so they can't be
so easily misused and/or hacked.
ActiveX controls are one of the leading sources of Spyware, Adware, and
other annoyances that have infiltrated the Internet over the last several
years. It's time for them to go away.
..NET controls are much more secure. Of course now we developers must deal
with the layers of security to achieve the functionality we need. Not so
great for us, but it is very good for the Internet in general.

--
I hope this helps,
Steve C. Orr
MCSD, MVP, CSM
http://SteveOrr.net
 
S

Seth Bourne

The old ActiveX controls download the binary (DLL or OCX files), it's like
the application downloaded and then run it from the client. does the .net
custom control have the similar architecture ?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top