End
Sub
</SCRIPT>
Notice...no compilation error, although nothing
happens.
Now, add under this under that script
:
<%
NoFrames
%>
And your Sub will execute...
For a more
practical example, instead of the simple NoFrames call, use :
<%
If
Request.QueryString("frames")="no" Then
NoFrames
Else
End
If
%>
If frames=no, the Sub will execute and render the
<noframes> text;
If frames=anythingelse, or if frames is not in the
querystring, the text will not be rendered.
To recap : if you do this :
<%
Private Sub
NoFrames
Response.Write("anything")
End Sub
%>
You will always get the error you are getting
now.
Procedures are
compilable only if their declaration context allows it.
If you
declare a Sub within a script block, it will compile.
<Script Language="VB" runat="server">
Sub
ThisWillCompileOK
End Sub
</SCRIPT>
If you declare a Sub within <%
... %> delimiters, it will not compile.
<%
Sub NoWayThisWillCompile
End
Sub
%>
best,