Learning ASP Series Getting Your Hands Dirty With VBScript


I know some people don't like VBScript for being
Microsoft-Centric, but it's very easy to get familiar with, and
once you know how to create your ASP pages in VBScript, you can
move on to any programming language of your choice.

First thing first: HTML tags and ASP scripts don't socialize
well, and although it is not a politically correct agenda, you
have to segregate them. Whenever you are writing the VBScript
code for ASP, enclose the code within <% %>.

So if you want to initialize a VBScript variable, do it like
this:

<%
Dim name
name "Tutan Khamen"
%>

For instance, if you want to use the variable "name" in your HTML
(ASP, actually) page, all you have to do is:

<%@LanguageVBScript%>
<% Option Explicit %>


Testing a VBSCript< itle><br/></head><br/><body><br/><%<br/>Dim name<br/>name "Tutan Khamen"<br/>%><br/><br/><p><%name%>! An ancient Egyptian mummy!</p><br/><br/></body><br/></html><br/><br/>Another example:<br/><br/><%@LanguageVBScript%><br/><% Option Explicit %><br/><html><br/><head><br/><title>Testing a VBSCript< itle><br/></head><br/><body><br/><%<br/>Dim number1, number2<br/>number1 33<br/>number2 44<br/>%><br/><br/><p>The product of <%number1%> and <%number2%> is <%number1 <br/>number2%></p><br/><br/></body><br/></html><br/><br/>So now its amply clear that whenever you want to insert Server<br/>Side code, or a part of it, you enclose it within <% %>.<br/><br/>You can try making short programs and test run the page.<br/><br/><p> About the Author <p>Amrit Hallan is a freelance web designer. For all web site<br/>development and web promotion needs, you can get in touch with<br/>him at http://www.bytesworth.com. For more such articles,<br/>visit http://www.bytesworth.com/articles and<br/>http://www.bytesworth.com/learn.</div><div class="panel panel-default" style="padding: 10px 10px 10px 10px;"><a class="btn btn-outline-primary btn-sm" href="/on/development/">development</a> <a class="btn btn-outline-primary btn-sm" href="/on/vbscript/">vbscript</a> <a class="btn btn-outline-primary btn-sm" href="/on/code/">code</a> <a class="btn btn-outline-primary btn-sm" href="/on/enclosein/">enclosein</a> </div> </div> </div> <!-- /#page-content-wrapper --> </div> <!-- /#wrapper --> <footer class="footer"> <div class="container-fluid text-right"> <p class="text-muted"><i class="fa fa-copyright" aria-hidden="true"></i> <a href="http://ondapc.com/" target="_blank">ondapc</a> project 2024</p> </div> </footer> <!-- CONTACT US --> <div class="modal" id="contact"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <h4 class="modal-title"><i class="far fa-envelope"></i> Contact Me</h4> <button type="button" class="close" data-dismiss="modal"><i class="fa fa-times"></i></button> </div> <div class="modal-body"> <form id="contactar" name="contactar" method="post"> <input type="hidden" name="token" value="0f83b1a020207f39b769ed9fd1745124"> <input type="hidden" name="captcha" value=""> <div class="form-group"> <div class="input-group-prepend"> <span class="input-group-text"><i class="fas fa-user"></i></span> <input class="form-control" id="name" name="name" placeholder="Your Name" required="required" value="" type="text"> </div> </div> <div class="form-group"> <div class="input-group-prepend"> <span class="input-group-text"><i class="far fa-envelope"></i></span> <input class="form-control" id="email" name="email" placeholder="Email" required="required" value="" type="email"> </div> </div> <div class="form-group"> <div class="input-group-prepend"> <span class="input-group-text"><i class="fas fa-edit"></i></span> <textarea name="message" id="message" class="form-control" rows="9" cols="25" placeholder="Write a message" required="required"></textarea> </div> </div> </div> <div class="modal-footer"> <button type="submit" class="btn btn-primary">Send <i class="fas fa-chevron-right"></i></button> </div> </div> </div> </div> <div id="contact" class="modal fade" role="dialog"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal"><i class="fa fa-times"></i></button> <h4 class="modal-title"><i class="fa fa-envelope-o"></i> Contact Me</h4> </div> <div class="modal-body"> </div> </div> </div> <script> $(function(){ $('#contactar').on('submit', function(e){ e.preventDefault(); $.ajax({ url: '/contactx/', type: 'POST', data: $('#contactar').serialize(), success: function(data){ $('#contactar')[0].reset(); $("#contact-success").append('<span><i class="fa fa-check"></i> Message Sent!</span>'); } }); }); }); </script> <!-- Bootstrap core JavaScript --> <script src="vendor/jquery/jquery.min.js"></script> <script src="vendor/bootstrap/js/bootstrap.bundle.min.js"></script> <!-- Menu Toggle Script --> <script> $("#menu-toggle").click(function(e) { e.preventDefault(); $("#wrapper").toggleClass("toggled"); }); </script> </body> </html> <!-- CACHE 0a1a0048cb144226eee236f484fdafef 2024-12-23 12:51:31 -->