Absolutely not.
The ASP code is executed on the server and nothing, except the result,
remain inside the HTML code when the page is displayed in the browser. If
you look at the source code from the browser, you will see that the function
setNarrowband() is totally missing. You need to use <script></script> tags
inside the HTML, with Javascript or VBScript code.
Also, when the HTML is displayed, you cannot write to it with a write
statement. It's something more complicated than that. Search Google for
DHTML (Dynamic HTML).
Try something like this instead:
<% response.write ........ %>
<script language=vbscript>
function SetNarrowBand()
msgbox "BROAD"
end function
</script>
There are other aspects, like the fact that the function setNarrowband may
or may not return a value and, if it returns a value, that this value can be
true of false. Different events, like onSubmit, onMouseOver, onClick, etc.,
may have a different response in each of these cases.
It will also explains why you will see something like
onClick="javascript:setNarrowband();" or
onClick="javascript:void(setNarrowband());" (Use javascript even if the
underlying function is coded in VBScript).
ASP.NET, which is not the same thing as ASP, bear some similitude to what
you have tried to do.
S. L.