Can someone tell me how to retrieve an ActiveX component with an OBJECT tag?
On my ASP file I have retrieved an ActiveX control with the following code:
<OBJECT classid="clsid:A919AF5F-637C-423E-835A-B56448C1AD9B">
</OBJECT>
The result is that the Activex control popup on the web page..so far so good.
The problem is that this piece of code always look for the ActiveX control
on the Client machine, I want the ActiveX control to be retrieved from the
server (of course)
In the documentation for the OBJECT tag, I saw that there was an attribute
called RUNAT=Server that should be included to get the object from the Server
instead, so I tried with the following code to retrieve the ActiveX from
the server instead of the clients machine
<OBJECT RUNAT=Server id=whatevername
classid="clsid:A919AF5F-637C-423E-835A-B56448C1AD9B">
</OBJECT>
...but, when I do like this, the ActiveX control doesn't show up. Can someone
understand why ?? Is it neccesary to instantiate the "whatever"-id before
I use it in the OBJECT-tag, or can this id be set to whatever value ? ....I
only want the ActiveX to show up in the clients browser, WHAT is wrong ??
ActiveX is a client-side technology only. It is designed to allow COM objects registered on the client machine to be instantiated in the browser.
Therefore, the question you should be asking is "How do I install/register my COM object on the client PC".
Bascially, you will need to add a codebase attribute to your object tag, specifying a URL to your (correctly packaged) ActiveX object. e.g.:
<object
classid="clsid:<guid>"
codebase="http://mydomain.com/path/to/mycabfile.cab">
</object>
The ActiveX object will typically be packaged in a CAB file and, if it was written in .NET, then it will need to be packaged in an MSI inside the CAB file.
For information on deploying a .NET ActiveX component from a web-server, please see my answer here.
For information on deploying a non .NET component, just search Google - it's much more straightforward than the .NET way!
Finally, if you are in an intranet environment, don't forget to consider using Active Directory Group Policy, or a similar technology (like SMS), for deploying the ActiveX component - it might be a lot simpler this way.
ActiveX showed up initially as client side component standard in 1995 but 4 years later became standard for server side wbe apps. All classic ASP web application systems/PHP/ColdFusion/Perl on Windows were built with non interactive ActiveX sever side components allowing increase of performance for interpreted VBScript-based web application code and access to all kind of APIs and distributed COM functionality on server side.
COM+ added possibility to run these components in efficient way e.g allowing pooling of COM+ applications/COM objects/threads.
ActiveX is a simplified version of OLE with only a two mandatory light weight interfaces to be implemented by COM component to be ActiveX (vs numerous interfaces required by OLE): IUnknown (lists available properties/methods exposed by ActiveX component) and IDispatch for late binding of methods and functions.
ActiveX server side support allowed simplistic generic type-based web app programming style without need to care about type declaration.
It supported popularity growth of XP programming style and Agile SDLC in general.
Related
How are third party controls exposed to "Windows Store apps" when app is written in HTML\JS?
Does the vendor have to provide a C#\VB.Net and WinJS version? And if so what work is involved in doing that, is it a complete re-write (I'm kind of assuming so but want to double check)?
If you want to share functionality like business logic and/or Windows Runtime access, you could create a one time component in C# and add it as a reference to your javascript project and use it as you would a regular javascript function.
When talking about UI, javascript and C# sit on top of different things. You have WinJS and HTML controls for javascript and XAML for C# so I don't see a way you could actually share a UI component thru the different languages.
We are currently using jQuery to populate web forms. jQuery receives its information from parsing the results of an executed php script. This works, but is completely dependent on the web server being accessible and functional.
We'd like to see how to consolidate this and create a C# console, WinForms application - or possibly a toolbar/IE addon of sorts down the road.
Right now we are trying to figure out how we can interact with an external Internet Explorer process (most examples we see are in regards to WebBrowser controls). We're ultimately wanting to fetch elements by name/id and populate them with text. From an end-user standpoint, we want to mimic the functionality of roboform.
We are not interested in form submission - just acqusition of the proper instance of IE and form population.
Are there any resources you could point us to that would have an example similar to our desire?
It used to be possible, I did that for IE7: How to connect to a running instance of Internet Explorer. I haven't verified if it still works for IE8+. You may also have some luck using this technique: How to get IHTMLDocument2 from a HWND.
hi i am using activex control in my asp.net application.
I add a reference of dll and write code
object id="vb" name="vbvbnv" classid="Bin/ClassLibrary5.dll#ClassLibrary5.UserControl1"
but when i run it's shows me output like this
http://screencast.com/t/ii87CY99j
in my activex control i use only button but it is not display there
The syntax that you're showing here is not ActiveX but instead what's called a UserControl. These are disabled in IE8 and later.
http://blogs.msdn.com/b/ieinternals/archive/2009/10/09/dotnet-usercontrols-do-not-load-in-ie8-internet-zone.aspx
Generally speaking, you should not write code to run inside IE in .NET languages.
ActiveX is a client-side code, so it needs to be installed on client's machine.
You should pack it as described here: Packaging ActiveX Controls.
We have a 3rd party ActiveX control namely Autodesk's "Design Review" that we would like to use in a non aspx environment. Most functionality is available through javascript, however one key method cannot be called from that environment. Searching on the Autodesk forums we found a solution that involves creating a COM wrapper around the control. I would assume that wrapper would then make the necessary modifications to the arguments passed in from javascript.
I assume this could be done by creating a C++ COM object wrapping the control. My question though is, can this be done in c# .net? We don't want to embed the control in a Windows form and pop it up on the web page. We can actually do this easily. What we want is to embed the control in the web page.
You can create a an assembly from the activex control using Windows Forms ActiveX Control Importer
ActiveX is COM so the technology for embedding it in a page has not change for 10-12 years ago. It is just plain HTML, with Object tag. This is pre-.NET and .NET has not made any enhancements last time I checked.
You can run C# and host it in IE and use ActiveX like that but you do not want to do it.
Have a look here:
http://www.w3schools.com/TAGS/tag_object.asp
I must say, however, that with all the limitations on running ActiveX in IE - because it was a security hole - it will not be a pleasant user experience for its users.
Our web page is only available internally in our company and we am very intrested in being able to offer interactive .net usercontrols on our departments website in the .Net 2.0 enviorment. I have been successful with embeding the object as so:
<object id="Object1" classid="http:EmbedTest1.dll#EmbedTest1.UserControl1"
width="400" height="400">
<param name="TestStr" value="Test Param String" />
</object>
The control worked just fine and the value was passed to the control without issue.
But I had a problem with passing subsequent values back to the embedded control
attempt to Recieve event from control:
attempt to update control:
<script type="text/javascript">
function UpdateStr()
{
Object1.Text = "update string";
}
</script>
Reference:
http://www.15seconds.com/issue/030610.htm
http://windowsclient.net/articles/iesourcing.aspx
Questions:
Is this technology outdated? - if so is there a replacement
Should I just work with action script instead of trying this?
I have got this to partially work and I was attempting to connect to a webservice that I have running and I got many security exceptions...I didn't get the same exceptions when I used action scipt2 in the same manner?
(side note : - how do i paste html script examples?)
Thanks.
Brad
Not out-dated so much as rarely used, and IE-only. If you want web-like deployment for desktop apps, use ClickOnce. If you want C# code that runs in the browser without security issues, use Silverlight. You could also look at XBAPs, which are sandboxed WPF apps that run in the browser, works on IE and Firefox, but requires the full .NET to be installed client-side, whereas Silverlight does not have this problem. Bottom line: look at Silverlight.
That's certainly an option. If you're more familiar with the Microsoft stack, you should try Silverlight, where you can code C# against a subset of the .NET framework right inside the browser.
We've used .NET controls in web pages internally and had a wide variety of strange issues, mostly related to scripting or security. Hard to determine the problem without more information.
p.s. write all code examples using the <pre> tags. There's a "code sample" button on the toolbar.
If the things that you are doing with the Windows Controls could be done with ASP.NET web controls instead, I recommend that you consider switching. You'll have much better control over the exchange of info from the client to the server.
1, 2) Yes it is outdated. If you want to work in .NET (and you're bent on having a control rather than an ASP.NET-style page/site), give Silverlight a try instead.
3) .NET code running in the browser is subject to very strict security controls (can't call back to a web site it didn't come from, for example).