VBScript won't run..

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • zensunni
    New Member
    • May 2007
    • 101

    VBScript won't run..

    I hope I'm in the right category, and assume that VBScript is a part of asp.net.

    Anyways, here is the code that will not run:

    Code:
    <html>
    <head>
    </head>
    <body>
    
    <script type="vbscript">
    
    document.write("Hello from VBScript!")
    </script>
    
    </body>
    </html>
    I have no idea how to get this to work in IIS. I feel like I've tried everything. The html will display, but the script won't. I've checked the event logs too, with no errors.

    I've even named the document with ".aspx" and ".asp" and ".html" extensions
  • zensunni
    New Member
    • May 2007
    • 101

    #2
    I realize now that VBScript is a CLIENT SIDE script, meaning it was only intended to run in internet explorer. Basically, it's just Microsoft's answer to javascript.

    Please correct me if I'm wrong.

    Comment

    • vikas251074
      New Member
      • Dec 2007
      • 198

      #3
      Hello
      Any other script is working or not?

      Thanks and regards,
      Vikas

      Comment

      • DrBunchman
        Recognized Expert Contributor
        • Jan 2008
        • 979

        #4
        Originally posted by zensunni
        I realize now that VBScript is a CLIENT SIDE script, meaning it was only intended to run in internet explorer. Basically, it's just Microsoft's answer to javascript.

        Please correct me if I'm wrong.
        VBScript can be a client side script but it can also be a server side scripting language if used between server tags (<% %>) on a page with a .asp extension.

        Pages with a .aspx extension are ASP.NET pages and are written using an Object Oriented language such as VB.NET or C#.

        Does this make sense?

        Dr B

        Comment

        • vikas251074
          New Member
          • Dec 2007
          • 198

          #5
          Yes sir, it makes a lot of sense.

          Thanks and regards,
          Vikas

          Comment

          • zensunni
            New Member
            • May 2007
            • 101

            #6
            I'm not sure I understand exactly. I know that anything between <%%> brackets will run asp like so:

            Code:
            <% response.write "Hello from ASP!" %>
            If I wanted to write VBScript server side, would I do this:

            Code:
            <%
            <script type="vbscript">
            document.write("Hello from VBScript!")
            </script>
            %>
            Or, does asp run certain VBScript syntax/functions?

            Also, how would a hello world document written in C#/VB look like in aspx? One thing I've never really understood is how to tag C#/VB code into a document.

            Comment

            • jeffstl
              Recognized Expert Contributor
              • Feb 2008
              • 432

              #7
              This is server side (file must be .asp for the server to know to compile and execute using the asp.dll)
              Code:
              <% response.write "Hello from ASP!" %>

              This is client side (code that executes in the browser) File can be any file type really, but this code will be browser dependant (only certain browsers will be able to run this)

              Also you don't need the <% %> for this code. Those mark ups are for ASP server side code only
              Code:
              <script type="vbscript">
              document.write("Hello from VBScript!")
              </script>

              Comment

              Working...