473,386 Members | 2,114 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

What is 'script' in a ASPNET file

Comming from JSP-HTML when I hear 'script' I think of JavaScript or perhaps
VBScript. But I think in ASP.NET they mean something else? I am bit confused
now.

Reading a book I see the following:

A simple Web page may look like the following.
<!-page directives-->
<%@ Page Language="VB" %>

<!--script-->
<script runat="server">
Private Sub SayHi(ByVal sender As Object, ByVal args As EventArgs)
Response.Write("Hello " + txtName.Value) End Sub
</script>

<!--layout-->
<html>
<head<title>Say Hi Page</title</head>

<body>
<form id="form1" runat="server"<input runat="server" id="txtName"
type="text" /<input runat="server" id="btnSayHi" type="button"
value="Say Hi" onserverclick="SayHi" />
</form>
</body>
</html>

Hence script refers to a piece of Visual Basic code here. Appearantly.

My question hence are:

1. Can you use javascript in ASP.NET pages?
2. Can you use VBScript in ASP.NET pages?
3 Does 'script' refer to the .NET C# or Visual Basic code, or to what I
should call real /scripting/ lanuguage code, like code in JavaScript of
VBScript?
4 Can anyone tell me if and what the difference would be with Java in a JSP
page and f.e. C# in an ASP.NET page

Marc Wentink

N.B. The question refers to the book I am reading Self Pace Training Kit for
the 70-528 Exam written by Glen Johnsson
Jun 27 '08 #1
12 1711
"Marc" <m,we******************@nki.nlwrote in message
news:ew**************@TK2MSFTNGP05.phx.gbl...
1. Can you use JavaScript in ASP.NET pages?
Yes.
2. Can you use VBScript in ASP.NET pages?
At a push. VBScript was the most popular server-side scripting language for
ASP Classic. However, ASP.NET uses the .NET Framework for server-side
interaction, usually with either C# or VB.NET. VBScript *can* be used for
client-side scripting, but that will work only in Microsoft IE. Therefore,
JavaScript is used almost exclusively for client-side scripting.
3 Does 'script' refer to the .NET C# or Visual Basic code, or to what I
should call real /scripting/ lanuguage code, like code in JavaScript of
VBScript?
ASP.NET allows server-side interaction either in-line or in code-behind -
which you use comes down to personal preference. When you use in-line
server-side coding, you use the
<script runat="server"/tag.
4 Can anyone tell me if and what the difference would be with Java in a
JSP page and f.e. C# in an ASP.NET page
ASP.NET uses the .NET Framework, and C# is a language which can be used to
program against the .NET Framework.
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Jun 27 '08 #2
There are two ways of creating code in ASP.Net. One is inline scripting,
which you are seeing. There, technically, it's not scripting as you
remember, but you would use the language of your choice - either VB.Net or
C# - so when you see VB - it's VB.Net coding - not VBScript, as it was in
Classic ASP days.

The other way that quite a few people use is 'code-behind', which is a
separate page for the coding, and it's tied to the ASPx page in the Page
directive

David Wier
http://aspnet101.com
http://iWritePro.com - One click PDF, convert .doc/.rtf/.txt to HTML with no
bloated markup
"Marc" <m,we******************@nki.nlwrote in message
news:ew**************@TK2MSFTNGP05.phx.gbl...
Comming from JSP-HTML when I hear 'script' I think of JavaScript or
perhaps VBScript. But I think in ASP.NET they mean something else? I am
bit confused now.

Reading a book I see the following:

A simple Web page may look like the following.
<!-page directives-->
<%@ Page Language="VB" %>

<!--script-->
<script runat="server">
Private Sub SayHi(ByVal sender As Object, ByVal args As EventArgs)
Response.Write("Hello " + txtName.Value) End Sub
</script>

<!--layout-->
<html>
<head<title>Say Hi Page</title</head>

<body>
<form id="form1" runat="server"<input runat="server" id="txtName"
type="text" /<input runat="server" id="btnSayHi" type="button"
value="Say Hi" onserverclick="SayHi" />
</form>
</body>
</html>

Hence script refers to a piece of Visual Basic code here. Appearantly.

My question hence are:

1. Can you use javascript in ASP.NET pages?
2. Can you use VBScript in ASP.NET pages?
3 Does 'script' refer to the .NET C# or Visual Basic code, or to what I
should call real /scripting/ lanuguage code, like code in JavaScript of
VBScript?
4 Can anyone tell me if and what the difference would be with Java in a
JSP page and f.e. C# in an ASP.NET page

Marc Wentink

N.B. The question refers to the book I am reading Self Pace Training Kit
for the 70-528 Exam written by Glen Johnsson

Jun 27 '08 #3

"Mark Rae [MVP]" <ma**@markNOSPAMrae.netwrote
>1. Can you use JavaScript in ASP.NET pages?
Yes.
But then client side, I presume?
<script runat="server"/tag.
Which means server side code, and hence code in a .NET assembly, not code in
a scripting language like JScript VBScript, et cetera, right? Actually I was
confused by calling code in server side modules script. I would, perhaps
only call client side interpreter (javascript) code script.

Thank you, thank you, & thanks
Jun 27 '08 #4
"Marc" <m,we******************@nki.nlwrote in message
news:eE**************@TK2MSFTNGP02.phx.gbl...
>>1. Can you use JavaScript in ASP.NET pages?
Yes.

But then client side, I presume?
That's right.
><script runat="server"/tag.

Which means server side code, and hence code in a .NET assembly, not code
in a scripting language like JScript VBScript, et cetera, right?
That's also right.
Actually I was confused by calling code in server side modules script. I
would, perhaps only call client side interpreter (javascript) code script.
I know what you mean! Microsoft's nomenclature can be very confusing at
times...

Generally speaking, when ASP.NET developers talk of "script" they are
referring to client-side, and when they talk of "code" they are referring to
server-side...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Jun 27 '08 #5
it holdover from asp (which was script based), which used the tag to define
server script blocks.

asp.net differs from asp and jsp in the rules for <% %and <script
runat="server">. the asp.net page is compiled into a class file.

all methods and class variables must be defined in <script runat="server">
as this code is paced between the class def, and the first method definition.

you can think of all the html and <% %code as all contained in one method
call. all html is converted to a new literal.html = html, and <%%code is
generated inline. this means code in <% %must be legal inside a method def.

<%= expression %is converted new literal.html = expression
-- bruce (sqlwork.com)
"Marc" wrote:
Comming from JSP-HTML when I hear 'script' I think of JavaScript or perhaps
VBScript. But I think in ASP.NET they mean something else? I am bit confused
now.

Reading a book I see the following:

A simple Web page may look like the following.
<!-page directives-->
<%@ Page Language="VB" %>

<!--script-->
<script runat="server">
Private Sub SayHi(ByVal sender As Object, ByVal args As EventArgs)
Response.Write("Hello " + txtName.Value) End Sub
</script>

<!--layout-->
<html>
<head<title>Say Hi Page</title</head>

<body>
<form id="form1" runat="server"<input runat="server" id="txtName"
type="text" /<input runat="server" id="btnSayHi" type="button"
value="Say Hi" onserverclick="SayHi" />
</form>
</body>
</html>

Hence script refers to a piece of Visual Basic code here. Appearantly.

My question hence are:

1. Can you use javascript in ASP.NET pages?
2. Can you use VBScript in ASP.NET pages?
3 Does 'script' refer to the .NET C# or Visual Basic code, or to what I
should call real /scripting/ lanuguage code, like code in JavaScript of
VBScript?
4 Can anyone tell me if and what the difference would be with Java in a JSP
page and f.e. C# in an ASP.NET page

Marc Wentink

N.B. The question refers to the book I am reading Self Pace Training Kit for
the 70-528 Exam written by Glen Johnsson
Jun 27 '08 #6
INLINE

"Marc" <m,we******************@nki.nlwrote in message
news:ew**************@TK2MSFTNGP05.phx.gbl...
Comming from JSP-HTML when I hear 'script' I think of JavaScript or
perhaps VBScript. But I think in ASP.NET they mean something else? I am
bit confused now.

Reading a book I see the following:

A simple Web page may look like the following.
<!-page directives-->
<%@ Page Language="VB" %>

<!--script-->
<script runat="server">
Private Sub SayHi(ByVal sender As Object, ByVal args As EventArgs)
Response.Write("Hello " + txtName.Value) End Sub
</script>

<!--layout-->
<html>
<head<title>Say Hi Page</title</head>

<body>
<form id="form1" runat="server"<input runat="server" id="txtName"
type="text" /<input runat="server" id="btnSayHi" type="button"
value="Say Hi" onserverclick="SayHi" />
</form>
</body>
</html>

Hence script refers to a piece of Visual Basic code here. Appearantly.

My question hence are:

1. Can you use javascript in ASP.NET pages?
Yes, for client side operations you can use JavaScript. In fact, all of the
AJAX bits output JavaScript to run on the client side.
2. Can you use VBScript in ASP.NET pages?
I would not use VBScript, personally, as it limits you to IE.
3 Does 'script' refer to the .NET C# or Visual Basic code, or to what I
should call real /scripting/ lanuguage code, like code in JavaScript of
VBScript?
I am sure some call the code "script", but I would not. The reason is
"script" generally means interpreted, not compiled. By interpreted, I mean
that the code in script runs in the browser, at run time. There is no
compilation step.
4 Can anyone tell me if and what the difference would be with Java in a
JSP page and f.e. C# in an ASP.NET page
Different object models. :-)

Essentially, if you are using JSP, you have Java for your server code and
JavaScript for your client code.

In ASP.NET, you have C#/VB for your server code and JavaScript for your
client code.

You can use VBScript in either, if you are so inclined.

Underneath the hood, the thinking process behind Java (JSP) and C#/VB
(ASP.NET) are quite different. And, each has its strengths and weaknesses.

Good enough?

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

Subscribe to my blog
http://gregorybeamer.spaces.live.com/lists/feed.rss

or just read it:
http://gregorybeamer.spaces.live.com/

********************************************
| Think outside the box! |
********************************************

Jun 27 '08 #7
the server code can be written in any .net language.

there are three out of the box (no additional installs required):
javascript.net (clr based)
c# (clr based)
vb.net (clr based)

there are couple common dynamic languages available

jscript.net (dlr based javascript - comes with silverlight)
ironpyhon (dlr based)
ironRuby (dlr based)
f# (dlr based)

you might want to look at the new mvc framework, which should replace
webforms for all enterprise programers.

-- bruce (sqlwork.com)
"Marc" wrote:
>
"Mark Rae [MVP]" <ma**@markNOSPAMrae.netwrote
1. Can you use JavaScript in ASP.NET pages?
Yes.

But then client side, I presume?
<script runat="server"/tag.

Which means server side code, and hence code in a .NET assembly, not code in
a scripting language like JScript VBScript, et cetera, right? Actually I was
confused by calling code in server side modules script. I would, perhaps
only call client side interpreter (javascript) code script.

Thank you, thank you, & thanks
Jun 27 '08 #8
re:
!javascript.net (clr based)

Is that still available ?
I don't see any option in VS 2008 to create a JScript.Net-based website.

I think that JScript.Net has been removed from our arsenal.

re:
!there are couple common dynamic languages available

With 3rd party tools, there's quite a few more.

I've been dabbling with PHP.NET, using Phalanger.

http://www.codeplex.com/Wiki/View.as...Name=Phalanger

If a PHP programmer wants to dabble with .NET, there's almost no learning curve.
Phalanger even integrates with Visual Studio.


Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
"bruce barker" <br*********@discussions.microsoft.comwrote in message
news:FE**********************************@microsof t.com...
the server code can be written in any .net language.

there are three out of the box (no additional installs required):
javascript.net (clr based)
c# (clr based)
vb.net (clr based)

there are couple common dynamic languages available

jscript.net (dlr based javascript - comes with silverlight)
ironpyhon (dlr based)
ironRuby (dlr based)
f# (dlr based)

you might want to look at the new mvc framework, which should replace
webforms for all enterprise programers.

-- bruce (sqlwork.com)
"Marc" wrote:
>>
"Mark Rae [MVP]" <ma**@markNOSPAMrae.netwrote
>1. Can you use JavaScript in ASP.NET pages?
Yes.

But then client side, I presume?
<script runat="server"/tag.

Which means server side code, and hence code in a .NET assembly, not code in
a scripting language like JScript VBScript, et cetera, right? Actually I was
confused by calling code in server side modules script. I would, perhaps
only call client side interpreter (javascript) code script.

Thank you, thank you, & thanks

Jun 27 '08 #9

"Cowboy (Gregory A. Beamer)" <No************@comcast.netNoSpamMwrote

Underneath the hood, the thinking process behind Java (JSP) and C#/VB
(ASP.NET) are quite different. And, each has its strengths and weaknesses.
Good enough?
Yes
I keep on reading the books.
:)
Jun 27 '08 #10
re:
!I don't see any option in VS 2008 to create a JScript.Net-based website.
!I think that JScript.Net has been removed from our arsenal.

I thought that I had seen an annoucement of that, so I looked it up...and here it is :

http://msdn.microsoft.com/en-us/vjsharp/default.aspx

<quote>
Since customers have told us that the existing J# feature set largely meets their needs
and usage of J# is declining, Microsoft is retiring the Visual J# product and Java Language
Conversion Assistant tool to better allocate resources for other customer requirements.

The J# language and JLCA tool will not be available in future versions of Visual Studio.

To preserve existing customer investments in J#, Microsoft will continue to support
the J# and JLCA technology that shipped with Visual Studio 2005 through to 2015
as per our product life-cycle strategy.
</quote>


Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
"Juan T. Llibre" <no***********@nowhere.comwrote in message news:%2****************@TK2MSFTNGP03.phx.gbl...
re:
!javascript.net (clr based)

Is that still available ?
I don't see any option in VS 2008 to create a JScript.Net-based website.

I think that JScript.Net has been removed from our arsenal.

re:
!there are couple common dynamic languages available

With 3rd party tools, there's quite a few more.

I've been dabbling with PHP.NET, using Phalanger.

http://www.codeplex.com/Wiki/View.as...Name=Phalanger

If a PHP programmer wants to dabble with .NET, there's almost no learning curve.
Phalanger even integrates with Visual Studio.


Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
"bruce barker" <br*********@discussions.microsoft.comwrote in message
news:FE**********************************@microsof t.com...
>the server code can be written in any .net language.

there are three out of the box (no additional installs required):
javascript.net (clr based)
c# (clr based)
vb.net (clr based)

there are couple common dynamic languages available

jscript.net (dlr based javascript - comes with silverlight)
ironpyhon (dlr based)
ironRuby (dlr based)
f# (dlr based)

you might want to look at the new mvc framework, which should replace
webforms for all enterprise programers.

-- bruce (sqlwork.com)
"Marc" wrote:
>>>
"Mark Rae [MVP]" <ma**@markNOSPAMrae.netwrote

1. Can you use JavaScript in ASP.NET pages?
Yes.

But then client side, I presume?

<script runat="server"/tag.

Which means server side code, and hence code in a .NET assembly, not code in
a scripting language like JScript VBScript, et cetera, right? Actually I was
confused by calling code in server side modules script. I would, perhaps
only call client side interpreter (javascript) code script.

Thank you, thank you, & thanks


Jun 27 '08 #11
Juan T. Llibre formulated on vrijdag :
re:
!I don't see any option in VS 2008 to create a JScript.Net-based website.
!I think that JScript.Net has been removed from our arsenal.

I thought that I had seen an annoucement of that, so I looked it up...and
here it is :

http://msdn.microsoft.com/en-us/vjsharp/default.aspx

<quote>
Since customers have told us that the existing J# feature set largely meets
their needs
and usage of J# is declining, Microsoft is retiring the Visual J# product and
Java Language
Conversion Assistant tool to better allocate resources for other customer
requirements.

The J# language and JLCA tool will not be available in future versions of
Visual Studio.

To preserve existing customer investments in J#, Microsoft will continue to
support
the J# and JLCA technology that shipped with Visual Studio 2005 through to
2015
as per our product life-cycle strategy.
</quote>

Isn't J# a language that Microsoft isn't allowed to call "Java", but
looks a lot like that?
While JScript.Net is a .Net enhancement of j(ava)SCRIPT (to be run on
the server side in a ASP.Net application).
Maybe it needs to be installed specifically (as opposed to C# and
VB.Net that get installed automatically)?

Hans Kesting
Jun 27 '08 #12
re:
!Isn't J# a language that Microsoft isn't allowed to call "Java", but looks a lot like that?
!While JScript.Net is a .Net enhancement of j(ava)SCRIPT
!(to be run on the server side in a ASP.Net application).

J#, Visual J# and vjsharp are all the same product, which is being retired.
You can *use* J# forever, but it won't be updated any more and support will end in 2015.

JScript and JScript.Net are Microsoft versions of JavaScript.
The latest version is JScript 8.0.

You can use JScript, if the redistributable is installed,
in an .aspx page by declaring it as the page language :

<%@ language="JScript" %>

You can also use it in Webservices, if the redistributable is installed :

<%@ WebService Language="JScript" class="YourClass"%>

re:
!Maybe it needs to be installed specifically
!(as opposed to C# and VB.Net that get installed automatically)?

You *can* install the Visual J# redistributable and it will work in VS 2008.

It's here :
http://msdn.microsoft.com/en-us/vjsharp/bb188598.aspx

Support for Visual J# is not natively offered in VS 2008, though.
Visual J# was removed from Visual Studio 2008.

You don't have to install it for VS 2005, because support for it is built-in,
although only for Windows and Console programs, not for Web applications.

To add to all this jumble, there's also "Managed JScript",
which is different from JScript *and* from JScript.Net.

It's used by Silverlight.

Read about the differences between the several flavors of JScript here:
http://blogs.msdn.com/gauravseth/arc...d-jscript.aspx


Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
"Hans Kesting" <ne*********@spamgourmet.comwrote in message news:%2****************@TK2MSFTNGP06.phx.gbl...
Juan T. Llibre formulated on vrijdag :
>re:
!I don't see any option in VS 2008 to create a JScript.Net-based website.
!I think that JScript.Net has been removed from our arsenal.

I thought that I had seen an annoucement of that, so I looked it up...and here it is :

http://msdn.microsoft.com/en-us/vjsharp/default.aspx

<quote>
Since customers have told us that the existing J# feature set largely meets their needs
and usage of J# is declining, Microsoft is retiring the Visual J# product and Java Language
Conversion Assistant tool to better allocate resources for other customer requirements.

The J# language and JLCA tool will not be available in future versions of Visual Studio.

To preserve existing customer investments in J#, Microsoft will continue to support
the J# and JLCA technology that shipped with Visual Studio 2005 through to 2015
as per our product life-cycle strategy.
</quote>


Isn't J# a language that Microsoft isn't allowed to call "Java", but looks a lot like that?
While JScript.Net is a .Net enhancement of j(ava)SCRIPT (to be run on the server side in a ASP.Net application).
Maybe it needs to be installed specifically (as opposed to C# and VB.Net that get installed automatically)?

Hans Kesting



Jun 27 '08 #13

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Stephane | last post by:
Hi, I built a application in .net which include a database, a windows service and a web site. I want to make a windows installer which would do: - Copy all files into the user system -...
1
by: wASP | last post by:
Hi, I'm a newbie starting up with ASP.NET, and I'm getting off to a wonderful start - and when I tell you "wonderful" I'm being sarcastic. My OS is Win 2000 SP4 - and I'm using IE6. I've...
2
by: Deb M. | last post by:
I am trying to find out how I can use the ASP.net framework yet still post the variables to an external script (not ASPX) after the form has been submitted. So, the ASPX page will still post to...
2
by: Hari | last post by:
Hi I have an ASP.NET application that writes to a log file in a directory outside the webapp directory (e.g. c:\program files\myapp\logs). OS is Windows 2003 If I see the list of users in the...
6
by: Benjamin Bittner | last post by:
Hallo NG, ive found this script http://www.iisfaq.com/default.aspx?View=A399&P=109. Now i want to use that script in a web application. can someone plz help me to convert it, or show me a way to...
7
by: M. Simioni | last post by:
Hi, i'm always auditing ASPNET's account accesses on my webserver, a WIN2K_SP4 + IIS5 + SQLServer2K_SP3a machine. Nearly all the applications work correctly, but i constantly find a message in...
10
by: Rob Nicholson | last post by:
In our application, we've added a bit of JavaScript that updates a title as the user types into a textbox. To trigger this, we patch into the "onkeyup" and "onpaste" events: ...
5
by: David Lozzi | last post by:
Hello, I'd like to create the SQL script for any given table, view or proc in my database, through ASP.Net using VB. I'm building a module library and providing this code on the fly would ease...
0
by: Anonieko | last post by:
REM This batch file addresses issues that exist with MS03-32 with REM V1.0 of ASP.NET on Windows XP only REM If you have any other configuration, you should not need to run this @echo off if...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.