By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,482 Members | 3,157 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,482 IT Pros & Developers. It's quick & easy.

Deployment of Windows User Controls for Web Pages

P: n/a
Hi,
Was wondering if anybody could point me in the right direction.

I'm looking at developing a Windows User Control using Visual Studio .NET
2005 in C#. The user control is to be used on a web page to replace an
existing Java applet. One of the main reasons for switching from Java to
the Windows User Control is to reduce the amount of the time spent maintain
two lots of source code, keeping the online and offline versions in sync.
So the creating a Windows User Control, would help in this matter.

I haven't seen many samples on how to achieve creating a Windows User
Control using C#. The ones that I have seen, seem to implement the Windows
User Controls like ActiveXs. Using the Object Tag in the HTML file, as
follows:

<object id="HelloWorldControl1"
classid="http://localhost/HelloWorldControlHost/HelloWorldControl.dll#HelloWorldControl.HelloWorld Ctl"
height="500" width="500" VIEWASTEXT>
</object>

Using the # to specify the Assemblyname and class to invoke.

Firstly, is this the correct way of doing it. Or is there a better method
that I haven't found as yet?

I also noticed that the when the custom control is download, it states that
it is unsigned. Am I correct in thinking that I will need to sign the
custom control, using a digital signature from Verisign?
Once signed, will the user still be prompted to install the control or is
there someway of avoiding the dialog be presented to them?

Is it also possible to use a cab file, just in case there are an additional
dlls that are required by the custom control ? If so will this be
transparent to the users, or will they see some sort of installation being
performed?

My major problem, is that I want this to work on as many machines as
possible. But nowadays a lot of system managers are restricting what can
and can't be installed on the users machines and I don't want to lose these
users....

Thanks

Wayne
Oct 24 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Hello Wayne,

On the MSDN site there is a webcast nugget that should help. You can download
it at:

http://download.microsoft.com/downlo...in_Browser.zip

Regards,
Andrew McNerlin
Hi,
Was wondering if anybody could point me in the right direction.
I'm looking at developing a Windows User Control using Visual Studio
.NET 2005 in C#. The user control is to be used on a web page to
replace an existing Java applet. One of the main reasons for
switching from Java to the Windows User Control is to reduce the
amount of the time spent maintain two lots of source code, keeping the
online and offline versions in sync. So the creating a Windows User
Control, would help in this matter.

I haven't seen many samples on how to achieve creating a Windows User
Control using C#. The ones that I have seen, seem to implement the
Windows User Controls like ActiveXs. Using the Object Tag in the HTML
file, as follows:

<object id="HelloWorldControl1"

classid="http://localhost/HelloWorldControlHost/HelloWorldControl.dll#
HelloWorldControl.HelloWorldCtl"

height="500" width="500" VIEWASTEXT>

</object>

Using the # to specify the Assemblyname and class to invoke.

Firstly, is this the correct way of doing it. Or is there a better
method that I haven't found as yet?

I also noticed that the when the custom control is download, it states
that
it is unsigned. Am I correct in thinking that I will need to sign the
custom control, using a digital signature from Verisign?
Once signed, will the user still be prompted to install the control or
is
there someway of avoiding the dialog be presented to them?
Is it also possible to use a cab file, just in case there are an
additional dlls that are required by the custom control ? If so will
this be transparent to the users, or will they see some sort of
installation being performed?

My major problem, is that I want this to work on as many machines as
possible. But nowadays a lot of system managers are restricting what
can and can't be installed on the users machines and I don't want to
lose these users....

Thanks

Wayne

Oct 24 '05 #2

P: n/a
Correct...I'd avoid the use of windows user controls in
a web browser like the plague. Even for IE users, you'll
run into all sorts of users who are either not permitted to
install your control or have problems getting it to work
once installed because of security settings.

It isn't worth the headaches...

Unless you need to work with files on the user's
desktop, I'd suggest writing the functionality in
script or write the core functionality you need
in the flash player. Many companies will permit
flash installs if it isn't already installed (which it is
very, very likely to already be there).

--
Robbe Morris - 2004/2005 Microsoft MVP C#
http://www.masterado.net

"Wayne Gibson" <wa**********@rendersoft.com> wrote in message
news:dj*******************@news.demon.co.uk...
Hi,
Was wondering if anybody could point me in the right direction.

I'm looking at developing a Windows User Control using Visual Studio .NET
2005 in C#. The user control is to be used on a web page to replace an
existing Java applet. One of the main reasons for switching from Java to
the Windows User Control is to reduce the amount of the time spent
maintain two lots of source code, keeping the online and offline versions
in sync. So the creating a Windows User Control, would help in this
matter.

I haven't seen many samples on how to achieve creating a Windows User
Control using C#. The ones that I have seen, seem to implement the
Windows User Controls like ActiveXs. Using the Object Tag in the HTML
file, as follows:

<object id="HelloWorldControl1"
classid="http://localhost/HelloWorldControlHost/HelloWorldControl.dll#HelloWorldControl.HelloWorld Ctl"
height="500" width="500" VIEWASTEXT>
</object>

Using the # to specify the Assemblyname and class to invoke.

Firstly, is this the correct way of doing it. Or is there a better method
that I haven't found as yet?

I also noticed that the when the custom control is download, it states
that it is unsigned. Am I correct in thinking that I will need to sign
the custom control, using a digital signature from Verisign?
Once signed, will the user still be prompted to install the control or is
there someway of avoiding the dialog be presented to them?

Is it also possible to use a cab file, just in case there are an
additional dlls that are required by the custom control ? If so will this
be transparent to the users, or will they see some sort of installation
being performed?

My major problem, is that I want this to work on as many machines as
possible. But nowadays a lot of system managers are restricting what can
and can't be installed on the users machines and I don't want to lose
these users....

Thanks

Wayne

Oct 25 '05 #3

P: n/a
Wayne,

Please do not cross post.
I haven't seen many samples on how to achieve creating a Windows User
Control using C#. The ones that I have seen, seem to implement the Windows
User Controls like ActiveXs. Using the Object Tag in the HTML file, as
follows:

[object id="HelloWorldControl1"
classid="http://localhost/HelloWorldControlHost/HelloWorldControl.dll#HelloWorldControl.HelloWorld Ctl"
height="500" width="500" VIEWASTEXT]
[/object]

Using the # to specify the Assemblyname and class to invoke.

Firstly, is this the correct way of doing it. Or is there a better method
that I haven't found as yet?
This is the new way of doing it. When using the new syntax, the security
will be managed by the CLR's CAS (code access security system).
Your control won't be able to do much w/out user's approval.
I also noticed that the when the custom control is download, it states that
it is unsigned. Am I correct in thinking that I will need to sign the
custom control, using a digital signature from Verisign?
Yes.
Once signed, will the user still be prompted to install the control or is
there someway of avoiding the dialog be presented to them?
It probably depends on user's Internet Explorer settings.
Is it also possible to use a cab file, just in case there are an additional
dlls that are required by the custom control ? If so will this be
transparent to the users, or will they see some sort of installation being
performed?
It is, but in this case you cannot use the way described above.
You have to do it the old ActiveX way:

- register the Control for COM interop
- mark the control: [ComVisible(true)]
- give it a GUID: [Guid("....")]
- package the cab
- sign the cab
- deploy

CRL's CAS doesn't interact (by default) with .NET controls exposed
as ActiveX objects. However, restrictive admins are able to ban
every .NET component they don't explicitly trust.
My major problem, is that I want this to work on as many machines as
possible. But nowadays a lot of system managers are restricting what can
and can't be installed on the users machines and I don't want to lose these
users....


Using .NET Controls would "slightly" limit the audience:
Internet Explorer and the .NET runtime are required.

Rob

Oct 26 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.