| HTML Tutorials |
|
|
| XML Tutorials |
|
|
| Browser Scripting |
|
|
| Server Scripting |
|
|
| .NET (dotnet) |
|
|
| Multimedia |
|
|
| Web Building |
|
|
| Java Tutorials |
|
|
| Programming Langauges |
|
|
| Soft Skills |
|
|
|
|
ASP Code:Procedures
|
<html>
<head>
<%
sub vbproc(num1,num2)
response.write(num1*num2)
end sub
%>
</head>
<body>
<p>
You can call a procedure like this:
</p>
<p>
Result: <%call vbproc(4,5)%>
</p>
<p>
Or, like this:
</p>
<p>
Result: <%vbproc 4,5%>
</p>
</body>
</html>
|
|
O/P:
You can call a procedure like this:
Result: 20
Or, like this:
Result: 20
|
|
|
ASP Procedures using JavaScript
|
|
|
|
ASP Procedure Using JavaScript:
|
<%@ language="javascript" %>
<html>
<head>
<%
function jsproc(num1,num2)
{
Response.Write(num1*num2)
}
%>
</head>
<body>
<p>
Result: <%jsproc(4,5)%>
</p>
</body>
</html>
|
|
|
|
|
Differences Between VBScript and JavaScript
|
|
When calling a JavaScript or a VBScript procedure from an ASP file written in VBScript, you can use the "call" keyword followed by the procedure name.
When using the "call" keyword,if a procedure requires parameters, the parameter list must be enclosed in parentheses .
If you omit the "call" keyword, the parameter list must not be enclosed in parentheses. The parentheses are optional,if the procedure has no parameters,
When calling a VBScript or a JavaScript procedure from an ASP file written in JavaScript, always use parentheses after the procedure name.
|
|
ASP Procedure Using Both VbScript And JavaScript
|
<html>
<head>
<%
sub vbproc(num1,num2)
Response.Write(num1*num2)
end sub
%>
<script language="javascript" runat="server">
function jsproc(num1,num2)
{
Response.Write(num1*num2)
}
</script>
</head>
<body>
<p>Result: <%call vbproc(5,4)%></p>
<p>Result: <%call jsproc(5,4)%></p>
</body>
</html>
|
|
O/P:
Result: 20
Result: 20
|
|
Share And Enjoy:These icons link to social bookmarking sites where readers can share and discover new web pages.
Keywords:
asp if statement response.write, asp if statement string,
asp if statement dim, asp tutorial
|
|
| HTML Quizes |
|
|
| XML Quizes |
|
|
| Browser Scripting Quizes |
|
|
| Server Scripting Quizes |
|
|
| .NET (dotnet) Quizes |
|
|
| Multimedia Quizes |
|
|
| Web Building Quizes |
|
|
| Java Quizes |
|
|
| Programming Langauges Quizes |
|
|
| Soft Skills Quizes |
|
|
|