|
What is a Browser
App?
Tutorial
HSP enables you to run
your ASP website/intranet applications right inside of
the Internet Explorer web browser. It does this by means
of a "pluggable protocol" (see
Overview page). This is
useful for running websites offline whenever necessary. An HSP Browser App consists of one or more .ASP and/or .HTM files. If you know how to program ASP, you already know how to program Browser Apps since HSP has a subset of the same objects and methods used in ASP. You can write any kind of program for the browser, the same as you would a traditional VB or C++ program. You just use the Internet Explorer browser as the runtime environment for your application. Of course, you can mix ActiveX controls on the webpage with your HTML, which increases the power and flexibility of your browser apps immensely.
This is a screenshot of a real browser app which connects to a remote database (a database located on a server "somewhere" on the Internet". idbView uses a product named InterAccess to communicate with the remote database). Each time the user clicks on a table name on the left, the table's contents are returned for viewing in the right pane. This particular app uses the Internet, but you could just as easily use ADO to view a local database on your PC or network.
How it works
Each time your .ASP webpage is loaded, the HSP
pluggable protocol executes any VBScript code found in the
page. This script can perform any task, such as read from
or update a database, or connect to a web service (SOAP)
and display the results. You can generate web pages
"on the fly" by mixing static HTML in the page
with dynamically read or generated data (from a database
for example).
Here is a code sample from the idbView HSP application:
<table border="0"
cellpadding="5" cellspacing="0"
width="98%">
<tr>
<td width="2%"
bgcolor="#000080">
<p align="center"><a href=#
onclick='OnLogout'>Logout</a></p>
</td>
<td width="57%"></td>
</tr>
</table>
<% option explicit %>
<!--#include relative = "Utils.inc"
-->
<!--#include relative =
"DisplayTable.inc" -->
<%
Dim dbConn, bOK, ds, bNextrows, iTimeout
On Error Resume Next
if IsEmpty( Session("dbConn") ) then
Response.Redirect("Login.asp")
end if
iTimeout = 60
bOK = False
bNextrows = False
set ds = Nothing 'preset to nothing
'is it a new listing request?
if Request("MoreData") <>
"" then
bNextrows = true 'must be a request for more rows
end if
set dbConn = Session("dbConn")
bOK = true
%> |
Conclusion
As you can see, HSP programming is the same as ASP
programming. The difference is, the program runs entirely
on the user's machine without ever connecting to a
webserver. Using the browser as the runtime environment
means that you can deploy browser applications that
consist of a single, small, easy to deploy file (EzWeb
Compiler
content storage file) whose runtime environment is the
Internet Explorer web browser.
|