Learn about Basic ASP Procedures (8 ASP):

8 asp

The JavaScript Procedures can be called by using VBScript in ASP. The ASP source codes can include procedures and functions in it. Following is the example that shows the procedures and functions in ASP source code using VBScript:

Example:

<html>

<head>

<%

Sub vbproc(n1,n)

response.write(n*n1)

end sub

%>

</head>

<body>

<p>Result is:<%call vbproc(2,4)%></p>

</body>

</html>

Result:

Result is: 8

 

Following is the example that shows the procedures and functions in ASP source code using JavaScript:

Example:

<%@ language=”JavaScript”%>

<html>

<head>

<%

Function jsproc(n1,n)

{

response.write(n*n1)

}

%>

</head>

<body>

<p>Result is: <%jsproc(2,4)%></p>

</body>

</html>

<script type=”text/javascript”><!–
google_ad_client = “ca-pub-7789281879799866”;
/* webpost */
google_ad_slot = “1930114734”;
google_ad_width = 300;
google_ad_height = 250;
//–>
</script>
<script type=”text/javascript
src=”http://pagead2.googlesyndication.com/pagead/show_ads.js”>
</script>

Result:

Result is: 8

Following is another example which shows how to call JavaScript procedures and VBScript procedures simultaneously in single ASP file:

Example:

<html>

<head>

<%

Sub vbproc(n1,n)

response.write(n*n1)

end sub

%>

<script language=”JavaScript” runat=”server”%>

Function jsproc(n1,n)

{

response.write(n*n1)

}

</script>

</head>

<body>

<p>Result is: <%call jsproc(2,4)%></p>

<p>Result is: <%call vbproc(2,4)%></p>

</body>

</html>

 

Result:

Result is: 8

Result is: 8

Some basics about the difference between VBScript and JavaScript:

To call VBScript or JavaScript procedures, you need to use the “call” followed by the procedure name in a ASP file written in VBScript. If you are using the”call” word then you need to use parenthesis for the parameters required by the procedure.  But if you are not using the “call” word then there is no need for parenthesis for parameters. Moreover, if there are no parameters in the procedure then the parenthesis are optional.

It is compulsory to use parenthesis in a ASP file written in JavaScript., when you need to call VBScript or Java

For more visit next posts in this category.To go back to Contents of this tutorial: ASP Active Server Side Scripting Contents

email

7 Responses to Learn about Basic ASP Procedures (8 ASP):

  1. Good news, you can go along with this right to the newspaper ! Maintain it likely buddie.

  2. I precisely had to say thanks yet again. I am not sure the things that I would’ve achieved in the absence of those recommendations provided by you directly on such a situation. It was before a real alarming issue in my circumstances, nevertheless seeing the very professional avenue you managed it took me to leap with contentment. I am just thankful for your work and thus trust you recognize what a great job you are always carrying out teaching the mediocre ones using a web site. Most likely you haven’t come across all of us.

  3. Jabbertype2 says:

    Snappoint2…

    Wonderful blog post, saw on…

  4. jlkutughk says:

    Online article…

    I just saw this really amazing post today….

  5. skaiwa says:

    Learn about Basic ASP Procedures (8 ASP): | online web design school, best online web design schools, online web design classes, building web page, I was suggested this web site by my cousin. I’m not sure whether this post is written by him as nobody else know such detailed about my trouble. You’re incredible! Thanks! your article about Learn about Basic ASP Procedures (8 ASP): | online web design school, best online web design schools, online web design classes, building web page,Best Regards Nick

  6. visit says:

    I like it when we get together and share views, great blog, keep it up.

  7. Spot on with this write-up, I really think this amazing site needs far more attention.
    I’ll probably be returning to read through more,
    thanks for the advice!

Leave a Reply