Before you do this to a “real” control, be sure to understand the consequences. We can get around this by modifying the browser security settings, but a more elegant way would be to mark the control as safe. This means that we won’t be able to create instances of our ActiveX class with JavaScript by default. } Mark the control as safe for scripting and initializationīy default IE will not allow initializing and scripting an ActiveX control unless it is marked as safe. Public class HelloWorld : UserControl, IHelloWorld This is what the file might look like: using System Make the HelloWorld class implement the IHelloWorld interface and have the GetText() method return a string of your choice. Make the control class implement the new interface let's us manually assign a GUID to the interface. Edit the ‘IHelloWorld.cs’ file so it looks like this: using System
0 Comments
Leave a Reply. |