在 ASP.NET 中,什么是“ASP”? 代码叫什么?

发布于 2024-07-08 16:39:06 字数 661 浏览 5 评论 0原文

我的问题的更多细节:

HTML 和 JavaScript 被称为“客户端代码”。

文件隐藏代码中的 C# 和 VB 称为“服务器端代码”。

那么什么是 inline-asp 和 'runat=server' 代码块呢?

<!-- This is called "client-side" -->
<p>Hello World</p>
<script>alert("Hello World");</script>

……

// This is called "server-side"
public void Page_Load(object sender, EventArgs e)
{
    Response.Write("Hello World");
}

<%-- What is this called ??? --%>
<asp:Label ID="MyLabel" runat="server" />
<% Response.Write("Hello World"); %>

我能想到的最好的术语是“Web Forms Code”

More detail to my question:

HTML and JavaScript are called "client-side code".

C# and VB in the code behind files are termed "server-side code".

So what is inline-asp, and 'runat=server' code blocks called?

<!-- This is called "client-side" -->
<p>Hello World</p>
<script>alert("Hello World");</script>

...

// This is called "server-side"
public void Page_Load(object sender, EventArgs e)
{
    Response.Write("Hello World");
}

...

<%-- What is this called ??? --%>
<asp:Label ID="MyLabel" runat="server" />
<% Response.Write("Hello World"); %>

The best term I can come up with is "Web Forms Code".

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

放我走吧 2024-07-15 16:39:06

明确地说,微软将它们称为嵌入式代码块。

http://msdn.microsoft.com/en-us/library/ms178135.aspx

它们是通过在渲染阶段调用而嵌入到页面生命周期中的代码块。

To be explicit, Microsoft calls them Embedded Code Blocks.

http://msdn.microsoft.com/en-us/library/ms178135.aspx

They are code blocks embeded into the page lifecycle by being called during the Render phase.

薔薇婲 2024-07-15 16:39:06

ASP 页面中以 <% 开头并以 %> 结尾的部分是 代码渲染带有 runat=server 的块

<%@开头的部分是指令。 以 <%= 开头的代码渲染块只是对 中的 writer.Write() 调用的简写Page.Render() 方法。

The sections of an ASP page that start with <% and end with %> are code render blocks and <script> elements with runat=server are called code declaration blocks. The code inside them is server code.

The parts that begin with <%@ are directives. The code render blocks that begin with <%= is just short hand for a call to writer.Write() in the Page.Render() method.

或十年 2024-07-15 16:39:06

在 MSDN 站点的 ASP 部分中,它们被称为“脚本命令”“服务器端脚本命令”“主脚本命令”

下面我包含了 MSDN 站点的摘录和参考链接。

ASP 使用分隔符 <% 和 %> 括起来脚本命令。 在分隔符中,您可以包含对您所使用的脚本语言有效的任何命令。

由分隔符括起来的命令称为主脚本命令,它们使用主脚本命令进行处理。脚本语言。 在脚本分隔符中使用的任何命令都必须对主要脚本语言有效。 默认情况下,主要脚本语言是 VBScript,但您也可以设置不同的默认语言。

(http://msdn.microsoft.com/en-us/library/ms524741.aspx)

In the ASP section of the MSDN site they are referred to as "script commands", "server side script commands" and "primary script commands".

Below I have included excerpts from the MSDN site and a reference link.

ASP uses the delimiters <% and %> to enclose script commands. Within the delimiters, you can include any command that is valid for the scripting language you are using.

Commands enclosed by delimiters are called primary script commands, which are processed using the primary scripting language. Any command that you use within script delimiters must be valid for the primary scripting language. By default, the primary scripting language is VBScript, but you can also set a different default language.

(http://msdn.microsoft.com/en-us/library/ms524741.aspx)

一笑百媚生 2024-07-15 16:39:06

我称它们为“服务器标签”或“服务器端标签”。

不知道这是否正确。

I call them "server tags" or "server-side tags".

No idea if this is correct or not.

找回味觉 2024-07-15 16:39:06

aspx 文件中的代码称为“标记”。其中还包括静态 html。 如果您想将范围缩小到 <% %> 标记内的代码,只需说“代码块”。

<% %> 标签本身和类似标签被称为“Bee Stings”。 请注意,这仅适用于不同类型的 <% %> 标记,而不是您使用它们创建的代码块。

Code in the aspx file is called "the markup". That includes static html, as well. If you want to narrow it down to code within <% %> tags just say "code blocks".

The <% %> tags themselves and similar are called "Bee Stings". Note that this is just for the different types of <% %> tags, not the code blocks you create with them.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文