Skype:TextControlSupport
Orders:877-462-4772
TX Text Control - word processing components.
« »

Activating the BrowserTextControl automatically

Blogged by Björn Meyer on October 26, 2007 and tagged with BrowserTextControl.

Since objects like Flash, ActiveX controls or .NET assemblies must be activated in Internet Explorer manually, you have to click on it to be able to use them. This is also valid for the BrowserTextControl of TX Text Control .NET Server. To read more about the reason for this change in Internet Explorer, please have a look at this blog entry.

Using ActiveX controls with the latest MSIE patch

To solve this issue in Internet Explorer 7.0, you have to add the object dynamically using Javascript. Just insert a DIV section into the ASPX page:

<div id="container">
</div>

This element will be used to add the object to the page. The Javascript that appends the object to the page must be a seperate file. In the ASPX page, we simply have to insert a reference to it:

<script src="script.js" type="text/javascript" language="javascript">
</script>

The Javascript itself creates a new object tag that will be added as a child to the container DIV section:

function activateControl(ContainerDIV,ClassID,Width,Height,Id)
{
var myObject = document.createElement('object');
var containerObject = document.getElementById(ContainerDIV);

containerObject.appendChild(myObject);
myObject.width = Width;
myObject.height = Height;
myObject.classid = ClassID;
myObject.id = Id;
}

activateControl('container','http:BrowserBin/BrowserApplication.dll#BrowserApplication.BrowserAppControl',800,600,'BrowserApp');
« Prev:Introducing a new sales engineer: Craig Anderson
» Next:New sample: Display line numbers on the page

top

Top 10 Bestselling Product Award 2007Top 25 Publisher Product Award 2007Top 10 Bestselling Product Award 2007 in JapanTop 25 Bestselling Product Award 2006Top 25 Bestselling Publisher Award 2006Reader's Choice Award, dot.net magazin, 3rd place