0
votes

I have a asp.net web page that im creating. and have a vbscript as the client side script. and the application will be accessed only from IE so thats not an issue. I get a weird error when i click on a button which is supposed to execute the client side vbscript instead it throws me a javascript runtime error?.

Is there a way to configure this ?.

By the way im moving from a HTA to asp page if someone can direct me as to how to implement this will be appreciated.

This is the html code for the button element

 <input type = "button"  value = "Display" name = "Run_Button" onClick = "getvalue">

This is the code for the client side vbscript

<script language="vbscript" type="text/vbscript">

Sub getvalue
  some text
End sub

Am i missing something? further i added the below line at the start of the html document

<%@language="VBScript"%>
1
the error im getting is "JavaScript runtime error: 'getvalue' is undefined" - Mani kv

1 Answers

0
votes

VBScript is no longer supported in IE11's "edge" mode, which your page will be rendered in if you're specifying <!doctype html>. You'll need to make a few changes to your webpage.

First, add the following <meta> tag to your <head> section:

<head>
    <meta http-equiv="x-ua-compatible" content="IE=10">
</head>

Second, all event handlers are considered to use JavaScript by default, so you'll need to call your function in one of two ways:

  1. Using JavaScript syntax (note the added () to getvalue):

    <input type="button" value="Display" name="Run_Button" onClick="getvalue()">
    
  2. Explicitly specify that you'll be using VBScript (no need to use () on getvalue):

    <input type="button" ... onClick="getvalue" language="VBScript">