Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBScript runtime error: Type mismatch: 'ready_it' was not handled

Status
Not open for further replies.

julin

Programmer
Apr 14, 2004
2
US
I am having a problem with an ASP page I am trying to write. When I try to execute <body onload="ready_it">, I get this error:

Microsoft VBScript runtime error: Type mismatch: 'ready_it' was not handled.

I do not get the error if I remove the 'runat=server', but I need that to create a object from a DLL registered on the server.

I am thoroughly confused. Any help would be appreciated. A code snippet of what I am trying to do is below.
Thanks, Johnny

<%@ Language=VBScript %>
<% Option Explicit %>
<% Response.Buffer = True %>
<% Response.Clear %>
<% Response.Expires = 0
Server.ScriptTimeout = 300 %>
<% Response.AddHeader "cache-control", "private" %>
<% Response.AddHeader "pragma", "no-cache" %>
<html>

<head>
<title>Estimator</title>

<script language="vbscript" runat=server>
<!--
SUB ready_it()
NPGrossIncome.value = 0
CPGrossIncome.value = 0
NPFedTax.value = 0
CPFedTax.value = 0
NPNetIncome.value = 0
CPNetIncome.value = 0
GuidelineAmountOfSupport.value = 0

Set objLookup = Server.CreateObject("MyDLL.Lookup")
END SUB
-->
</script>
</head>

<body onLoad="ready_it()" language="vbscript">
</body>
</html>
 
you can't run a server-side function (runat=server) after a client-side event (onLoad)

Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook (No, I'm not Rick)

zen.gif
 
I have somewhat of a problem then. I need to be able to do both server and client side processing somehow. For example, a user enters a gross income. The net income is then calculated. When they tab from the gross income field, a method in a DLL residing on the server needs to fire to lookup a dollar value for the page. Next, the user may enter a deduction value in one of many other fields. Net income is re-calculated each time and a new dollar value needs to be looked up using the server resident DLL. Possible???
 
I believe that you will need to submit the page each time then so that you can use server-side processing to handle the form data. I do not know of a way to keep a continuous communication between the server and the client...

Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook (No, I'm not Rick)

zen.gif
 
You could use RS Objects(Remote Scripting Objects) to maintain an client/server connection without leaving the page but this is IE only and you could not have suport for that.
I've used and it works preatty well. But has it's limits.

________
George, M
Searches(faq333-4906),Carts(faq333-4911)
 
Possible - yes. Through remote scripting (check MSDN for that), IE download behaviors or some tricks w client-side SCRIPT tag.

Practical - depends on purpose.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top