Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asptoday_discuss thread: Re: Calling ASP functions in VBScript or Javascirpt


Message #1 by "Lingasamy K" <lingasamyk@h...> on Fri, 12 Apr 2002 13:30:58
you can call a function from vb script tag and also from a 
vbscript function to a vbscript function but you have to mention in the
script tag as runat = server.

I hope the following code will help you in better way

In the following code there are two functions inside the vbscript tag

that is getDataFromScript() and getData(),

here the function getData is called which inturn calls getDataFromScript 
to get
the data and fills it in the variable.


<%@ Language=VBScript %>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
</HEAD>
<SCRIPT Language = VbScript RunAt = "Server">
	function getDataFromScript()
		getDataFromScript = 30
	end function

	function getData()
		getData = getDataFromScript
	end function
	
</SCript>
<BODY>
<%
	result = getData	
	Response.Write "<b>" & result & "</b>"
%>
<P>&nbsp;</P>

</BODY>
</HTML>

  Return to Index