HOWTO: Modifying .alx File Objects from Active Server PagesID: Q157748
|
Internet Information Server (IIS) Active Server Pages (ASP) can be used to modify information in an ActiveX Layout file (.alx). To do this, server side scripting should be placed in the .alx file.
Active Server Pages are run when the URL is processed by IIS. At this time,
the controls in an .alx file have not been created in Internet Explorer
(IE). Because of this, it is impossible to change a control in an .alx file
from the HTTP document hosting the .alx file using server-side scripting.
To do this, place the server-side scripting code in the .alx file itself.
When IE calls for the .alx file, IIS processes the server-side script
before handing the .alx file back to IE. The key to making this all happen
is to rename the .alx file with an ASP extension.
NOTE: The following example assumes that the Adventure Works sample site is installed and working. It draws data from the AdvWorks data source.
To see an example of how this all works, use the following steps:
<OBJECT CLASSID="CLSID:812AE312-8B8E-11CF-93C8-00AA00C08FDF"
ID="layout1_alx" STYLE="LEFT:0;TOP:0">
<PARAM NAME="ALXPATH" REF VALUE="layout1.asp">
</OBJECT>
<%
Set Con = Server.CreateObject("ADODB.Connection")
Conn.Open "AdvWorks"
rs = Conn.Execute("SELECT * FROM products")
%>
<PARAM NAME="Caption" VALUE="label1">
With the following line:
<PARAM NAME="Caption" VALUE="<% Response.Write rs(1).Name %>">
<PARAM NAME="Value" VALUE="test">
With the following line:
<PARAM NAME="Value" VALUE="<% Response.Write rs(1) %>">
For the latest Knowledge Base articles and other support information on Visual InterDev and Active Server Pages, see the following page on the Microsoft Technical Support site:
http://support.microsoft.com/support/vinterdev/
Additional query words:
Keywords : kbADO kbASP kbASPObj kbGrpASP
Version : winnt:
Platform : winnt
Issue type : kbhowto
Last Reviewed: May 26, 1999