<% If Request("DontFrame")<>1 Then Response.Redirect "/iissamples/sdk/asp/docs/SampFram.asp?ovfile=/iishelp/iis/htm/sdk/samp4m7b.asp&srcfile=Interaction/ClientScript" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
ASP is a server-side scripting environment. Client-side scripting complements ASP nicely, allowing for a number of enhancements, such as ActiveXÖ controls, that can make your application more powerful and user-friendly.</p>
<p>
This example demonstrates how you can include a client-side script in your language. This script defines a subroutine called <b>DoIt</b> within the <SCRIPT> tags. Notice that there is not a RUNAT=SERVER attribute present, which would indicate that the script is an ASP subroutine. The page provides one button for the user that, when clicked, executes the <b>DoIt</b> subroutine on the client browser. </p>
<p>
This sample demonstrates a very useful advantage to combining ASP scripts with client-side scripting. When ASP encounters the <SCRIPT> tags, it does not simply ignore everything within that block. It continues to search for, parse, and execute script elements, specified with delimiters (<% ... %>), that are meant for the server. This example, therefore, returns the session information returned from the <b>Session.SessionID</b> method within a client-side script. </p>