ALP Server.ExecuteEx method
Executes another page, script or other module and returns the content generated by it. 


x = Server.Execute( url [, type [, cp ]] )


url - string containing the virtual path, relative path or full URL to the other resource/page

type - 0 (default) - the returned content is converted to string, 1 - the returned content is returned as binary data.

cp - When the type is 0 this specifies the code page that will be used when the content is converted to string. The default code page is the current user's code page. 

Usually this method is used with parameters pointing to another page in the same site/application. However in ALP it is possible to call this method with external URL - for example online WEB page or even other namespace (such as mk: for a page from help file etc.). Warning: using external URL is not guaranteed to work correctly on Windows 95.



<% s = Server.Execute("" & Slot) %>
<%= s %>
<% Server.Execute("/pages/page.html") %>


Like in the #include directive, Server.MapPath the ExecuteEx method accepts relative or virtual paths. A relative path is a path resolved upon the location of the currently displayed page and virtual path is path resolved upon the root of the site (the closest parent directory containing an file). So:


is a relative path


is a virtual path

Usage of ../ is accepted but not recommended as it is often source of human mistakes when moving the pages across the site. 


The method can be used to obtain the content generated by another page and process that content further. For example you can construct a simple custom service page that returns some information you would wont to parse.

Applies to: Server object

newObjects Copyright 2001-2006 newObjects [ ]