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.
Related
When am work on webBrowser control using wpf Getting error like "script error" even i pasted screen shot here and even some jquery UI and css not working
I faced this problem too. I need to create browser application which the web has lot of Jquery, JSON etc and webbrowser control does't work as expected (I'm using Windows 10 and Visual Studio 2015)
As solution, I use cefsharp.github.io which allow me to embed a full-featured standards-complaint web browser into C# or VB.NET project solution without hacking windows registry key. It based on Chromium Embedded Framework. It work like a charm!
Just grab nuget packages and create ChromiumWebBrowser class and you are ready to use it.
You have to change your WebBrowser rendering engine, by default it uses the oldest one.
In this link Microsoft describes how you can do it:
http://msdn.microsoft.com/en-us/library/ie/ee330730%28v=vs.85%29.aspx
And you can follow this good answer too.
Will the IE9 WebBrowser Control Support all of IE9's features, including SVG?
Pay attention that if you are running a 32 bit app on a 64bit system you must set this key instead
[HKLM\SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION]
I tried the site that fails in your screenshot and works well with this registry change from a WebBrowser.
Looking for a solution to my issue. We are building a web browser control into a product for a client, they need to be able to detect when there is a File Upload box on a website, then instead of it launching the Windows 7 File Browser window, it needs to open their own custom designed one
Is there a browser event that allows us to capture that?
You can hook up your own download manager that is effective only in your webbrowser control host process by implementing IServiceProvider in the control site and implement QueryService to return an IDownloadManager object when asked by the webbrowser control
In Windows Form's Webbrowser class, a control site is created for you by default, but you can override the control site by create your own WebBrowserSiteBase class and override the WebBrowser.CreateWebBrowserSiteBase Method. There is no such extensibility if you use the webbrowser control from WPF, Silverlight or Windows Phone.
I suggest you write the download manager in C++ due to the amount of interop required if you code in C#. There's an example for a C# webbrowser control using a native download manager here.
You can catch the FileDownload event, and handle it yourself.
See http://msdn.microsoft.com/en-us/library/bb268220(v=vs.85).aspx
After showing your custom file dialog, send the data back to the webbrowser control, and submit the form.
Another option is to inject javascript into the control. Inject a code that replaces the call from the upload button, and show a form of your own instead.
So you want to modify the value of <input type=file .... You cannot do that with webbrowser control because it accesses DOM like javascript, vbscript vs. And if DOM allowed accessing and changing the uploaded file bad guys could easily steal your local files (using javascript) when you visit their pages.
Furthermore you can't even see the value of FileUpload because of that security issue.
If you want to select a file programmatically that is possible with a combination of SendKeys
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.
This is the code I am using:
tabPage1.Controls.Add(AXViewer1);
where AXViewer1 is a third party ActiveX control (non .NET) that I want to add to my tab page.
Is it wrong to do it the way I did, since it has not added it to the tab page with that code?
Your ActiveX control probably cannot be reparented at runtime.
You need to create a new instance of the class at runtime by writing new AXViewer().
Try setting the Visible property to True. Also try calling the CreateHandle method.
If none of this works, you are best off contacting the developer of the ActiveX control for support.
Is it possible loading C# form (or C# application) into ActiveX control? I know how to load ActiveX control to C# form....
You can call a .Net form in VB6 (with Interop Forms Toolkit 2.0), and you can use VB6 to create an ActiveX so my guess is that it is possible.
I have also heard of ppl used forms created from .net-dlls and den using setparent-api and got it to act as a child to vb6-form.
All in all, yes it seems possible to load an C#-form in an activeX control.
Interop Forms Toolkit 2.0: display .NET Winforms in VB6 Applications
http://hubpages.com/hub/Interop_Forms_Toolkit_20
And someone using SetParent, not a solution but from this its easy to google away to other solutions.
http://www.eggheadcafe.com/forumarchives/NETFrameworkinterop/Oct2005/post24062147.asp