all groups > visual studio .net general > february 2007 >
You're in the

visual studio .net general

group:

Replace ActiveX on ASP page with a .NET Windows Forms component


Replace ActiveX on ASP page with a .NET Windows Forms component Ted
2/22/2007 5:37:36 PM
visual studio .net general:
Hi,

I have a classic ASP web page which contains an ActiveX component writtent
in VB6. The client side Java script on the ASP page communicates with this
component by accessing its properties and methods. The activeX control has
a UI and the user edits data using this UI. The java script on the ASP page
gets this data from the ActiveX using its properties and save it in the XML
data island. The ActiveX never interacts with the server directly.

I need to replace the ActiveX on this ASP page with a Windows forms
application/component written in .NET 2.0. I do not want to make
significant changes in the java script and the way javascript interacts with
the component. I thought of Smart Client, but I didn't see a way to expose
its properties to the javascript on the asp page.

In short, I am trying replace the ActiveX control with a Windows Forms
component written in .NET without making significant changes to the ASP
page.

Please help!
Thanks,
Ted

RE: Replace ActiveX on ASP page with a .NET Windows Forms component wawang NO[at]SPAM online.microsoft.com
2/23/2007 12:00:00 AM
Hi Ted,

When hosting a Windows Forms component in IE, you could still use jscript
or vbscript to interact with it. However, you should be aware that it will
require the .NET Framework installed at client-side and it has more strict
permission when compared to an ActiveX Control.

I've collected some further reading for you, please review them accordingly
and let me know if you have any questions, thanks.


#DHTML and .NET: Host Secure, Lightweight Client-Side Controls in Microsoft
Internet Explorer -- MSDN Magazine, January 2002
http://msdn.microsoft.com/msdnmag/issues/02/01/UserCtrl/default.aspx

#Configuring Internet Explorer Applications (.NET Framework Developer's
Guide)
http://msdn.microsoft.com/library/en-us/cpguide/html/cpconconfiguringieappli
cations.asp?frame=false

#HOW TO: Use the IEHost Log to Debug .NET Object Hosting in Internet
Explorer
http://support.microsoft.com/default.aspx?scid=kb;en-us;313892

#A Runtime in Every Pot
http://msdn2.microsoft.com/en-us/library/bb250507.aspx

#Hosting Controls in Internet Explorer
http://msdn2.microsoft.com/en-us/netframework/aa497374.aspx#qjnbjp8n

#Using Windows Forms Controls in Internet Explorer
http://windowsforms.net/articles/iesourcing.aspx



Sincerely,
Walter Wang (wawang@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications. If you are using Outlook Express, please make sure you clear the
check box "Tools/Options/Read: Get 300 headers at a time" to see your reply
promptly.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
RE: Replace ActiveX on ASP page with a .NET Windows Forms component wawang NO[at]SPAM online.microsoft.com
2/27/2007 12:00:00 AM
Hi Ted,

I am interested in this issue. Would you mind letting me know the result of
the suggestions? If you need further assistance, feel free to let me know.
I will be more than happy to be of assistance.

Have a great day!

Regards,
Walter Wang (wawang@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
Re: Replace ActiveX on ASP page with a .NET Windows Forms component Ted
2/27/2007 6:48:21 PM
Hi Walter,

Thanks... The links you provided helped me a lot to find a way to host a
windows forms control in .NET. I successfully hosted a .NET Windows Forms
control in IE and accessed it's properties using java script. I didn't try
out the events yet, but I think it will work. I did this using .NET 1.0
controls. I could not make it work in .NET 2.0. I saw a discussion on this
topic
(http://www.c-sharpcorner.com/UploadFile/dsandor/ActiveXInNet11102005040748AM/ActiveXInNet.aspx)
and I will try this again once I resolve my critical issue given below.

Though initially I thought I got the solution, my problem turned out to be
little different. In the current asp page I have a link and clicking this
link pops up the the ActiveX control. The ActiveX control (this is an OCX
control) has its own UI, and it looks like a standalone windows application
with control box, menus and the colse button (X button). The asp page that
launched this control interacts with it using java script.

All the solutions given on internet talk about hosting the control on IE,
which means the control should displayed on the asp page along with all
other information on the page. This will not work in my scenario. In my
case, the asp page will have a link and clicking this link should launch the
control in its own window, and the parent asp page should be able to access
the control's properties, methods, and events so that the data store( the
xml island on the parent asp page) is always updated whenever the data is
changed by the control. The data communicated between the control and the
asp page is in the form of xml strings with an average length of ten
thousand characters.

Please help me if you find any way for doing this. I am continuing my
research and will let you know if I come across any solution.

Thank you very much for the help,
Ted



[quoted text, click to view]

Re: Replace ActiveX on ASP page with a .NET Windows Forms component wawang NO[at]SPAM online.microsoft.com
3/1/2007 12:00:00 AM
Hi Ted,

For the question about not being able to host .NET 2.0 winform control, are
you using the built-in webserver of ASP.NET 2.0 to test the control? Based
on my test, it should work in IIS 5.x and 6.0. I also found an empty
TextArea shows up when I test it in the built-in web server of ASP.NET 2.0.

If this is not the case, you might want to take a look at following blog to
see this is the same cause:

#A developer's strayings : Http compression and WinForm controls as legacy
ActiveX
http://blogs.msdn.com/carloc/archive/2006/09/09/746947.aspx

For your second question about hosting the control in its own window, I'm
not sure if I fully understand it: when hosting WinForm control in IE, a
real ActiveX Control IEHOST is first loaded into IE and then it loads your
..NET assembly. For IE, it's still interacting with an ActiveX Control, I
don't see why it's not working for your case. Perhaps a little more
explanation on your usage scenario would help. Thanks.

Regards,
Walter Wang (wawang@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
Re: Replace ActiveX on ASP page with a .NET Windows Forms component wawang NO[at]SPAM online.microsoft.com
3/7/2007 1:39:48 PM
Hi Ted,

Please feel free to let me know if there's anything I can help.

Regards,
Walter Wang (wawang@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
AddThis Social Bookmark Button