什么是ASPNET文件中的“脚本” [英] What is 'script' in a ASPNET file

查看:43
本文介绍了什么是ASPNET文件中的“脚本”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我听到''脚本'时,从JSP-HTML开始,我想到了JavaScript或者可能是

VBScript。但我认为在ASP.NET中它们意味着什么呢?我有点困惑

现在。


读一本书我看到以下内容:


一个简单的网页可能如下所示。

<! - 页面指令 - >

<%@ 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 = QUOT; btnSayHi" type =" button"

value =" Say Hi" onserverclick = QUOT; sayHi的" />

< / form>

< / body>

< / html>


因此脚本在这里指的是一段Visual Basic代码。好的。


我的问题是:


1.你能在ASP.NET页面中使用javascript吗?

2.你能在ASP.NET页面中使用VBScript吗?

3''script''是指.NET C#或Visual Basic代码,还是我所说的
应该调用real / scripting / lanuguage代码,比如JavaScript中的代码
VBScript?

4任何人都可以告诉我在JSP中是否与Java有什么区别

页面和fe ASP.NET页面中的C#


Marc Wentink


N.B.这个问题涉及我正在阅读的书Self Pace Training Kit for

70-528考试由Glen Johnsson撰写

解决方案

< BLOCKQUOTE>"马克" < m,我们****************** @ nki.nlwrote in message

news:ew ********** **** @ TK2MSFTNGP05.phx.gbl ...


1.您可以在ASP.NET页面中使用JavaScript吗?



是。


2.你能在ASP.NET页面中使用VBScript吗?



推动。 VBScript是

ASP Classic中最受欢迎的服务器端脚本语言。但是,ASP.NET使用.NET Framework进行服务器端

交互,通常使用C#或VB.NET。 VBScript *可用于

客户端脚本,但这只适用于Microsoft IE。因此,

JavaScript几乎专门用于客户端脚本。


3''script''是指.NET C#或者Visual Basic代码,或者我应该调用真实/脚本/语言代码的代码,比如

VBScript的JavaScript中的代码?



ASP.NET允许在线或代码隐藏中的服务器端交互 -

您使用的归结为个人偏好。当你使用内联

服务器端编码时,你使用

< script runat =" server" / tag。


4在

JSP页面和fe中,是否可以告诉我是否与Java有什么区别? ASP.NET页面中的C#



ASP.NET使用.NET Framework,C#是一种可用于支持
的语言针对.NET Framework的程序。

-

Mark Rae

ASP.NET MVP
http://www.markrae.net


在ASP.Net中有两种创建代码的方法。一个是内联脚本,你看到的是
。从技术上讲,它不是脚本,因为你记得,但是你会使用你选择的语言 - 无论是VB.Net还是

C# - 所以当你看看VB - 它是VB.Net编码 - 而不是VBScript,因为它是在

经典ASP天。


另一种方式相当多人们使用的是代码隐藏,这是一个单独的编码页面,它与页面

指令中的ASPx页面相关联


David Wier
http://aspnet101.com
http://iWritePro.com - 点击PDF,转换.doc /.rtf/.txt到HTML没有

膨胀的标记

" Marc" < m,我们****************** @ nki.nlwrote in message

news:ew ********** **** @ TK2MSFTNGP05.phx.gbl ...


当我听到''脚本'时,从JSP-HTML开始我想到了JavaScript或者
也许是VBScript。但我认为在ASP.NET中它们意味着什么呢?我现在很有困惑。


读一本书我看到以下内容:


一个简单的网页可能如下所示。

<! - 页面指令 - >

<%@ 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 = QUOT; btnSayHi" type =" button"

value =" Say Hi" onserverclick = QUOT; sayHi的" />

< / form>

< / body>

< / html>


因此脚本在这里指的是一段Visual Basic代码。好的。


我的问题是:


1.你能在ASP.NET页面中使用javascript吗?

2.你能在ASP.NET页面中使用VBScript吗?

3''script''是指.NET C#或Visual Basic代码,还是我所说的
应该调用real / scripting / lanuguage代码,比如JavaScript中的代码
VBScript?

4任何人都可以告诉我是否和Java有什么区别

JSP页面和fe ASP.NET页面中的C#


Marc Wentink


N.B.这个问题是指我正在阅读自学步训练套件的书。

为格伦约翰逊撰写的70-528考试




" Mark Rae [MVP]" < ma ** @ markNOSPAMrae.netwrote


> 1。你能在ASP.NET页面中使用JavaScript吗?



是的。



但客户方面,我认为?


< script runat =" server" /标签。



这意味着服务器端代码,因此.NET程序集中的代码,而不是像JScript VBScript等等的
a脚本语言中的代码, 对?实际上,通过调用服务器端模块脚本中的代码,我感到很困惑。我愿意,也许

只调用客户端解释器(javascript)代码脚本。


谢谢,谢谢,&谢谢


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

解决方案

"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


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




"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


这篇关于什么是ASPNET文件中的“脚本”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆