Client Scripts

  • Thread starter Thread starter Jim Heavey
  • Start date Start date
J

Jim Heavey

Trying to learn ASP.Net and I have a few simple (or at
least I hope they are simple).

If you are creating "codebehind" to hold all of your
code, would you also place any client scripts here as
well or do they still have to go on the .aspx form?

If I write my script in VB or C#, will it automatically
be translated into JavaScript if a non-IE browser is
detected?

I am trying to write my first "client side" script for a
CustomValidator. Using some of the documentation that I
have, it show the example in c# and shows it as a
function. I wrote a VB function in which the header
looks like the following:

public function ValidateCustNumberValue2(source, args)

but every time I run I get an error which says the
following "Microsoft JScript runtime error: Object
expected". Why does it say JScript? I have the function
enclosed in <Script tags which indicates the language
is "VB" (<script language="vb">).

What do I need to do to get this script to run?
 
Trying to learn ASP.Net and I have a few simple (or at
least I hope they are simple).

If you are creating "codebehind" to hold all of your
code, would you also place any client scripts here as
well or do they still have to go on the .aspx form?
You can put the client side stuff in it's own file and add a reference
to it in your aspx page like

<script language="JavaScript" src="includes/menu.js"
type="text/javascript"> said:
If I write my script in VB or C#, will it automatically
be translated into JavaScript if a non-IE browser is
detected?
I very much doubt it.
I am trying to write my first "client side" script for a
CustomValidator. Using some of the documentation that I
have, it show the example in c# and shows it as a
function. I wrote a VB function in which the header
looks like the following:

public function ValidateCustNumberValue2(source, args)
Are you sure that's not meant to run server-side?
but every time I run I get an error which says the
following "Microsoft JScript runtime error: Object
expected". Why does it say JScript? I have the function
enclosed in <Script tags which indicates the language
is "VB" (<script language="vb">).
I don't use VB but shouldn't that be vbscript?
What do I need to do to get this script to run?
Personally I do client side stuff in javascript. I'd reckon it's more
likely to work on more browsers. Most of the stuff I see on the net
usually seems to be javascript as well.
 
Back
Top