什么叫?它们可以在页面中以何种方式使用

时间:2021-10-19 18:05:58

In a .Net web form...

在.Net网络表单中......

What are these special tags called?

这些特殊标签叫什么?

I know of 2: <%-- comment --%> for comments

我知道2:<% - comment - %>的评论

and <%# used with Eval and Bind #>

和#%#与Eval和Bind#>一起使用

So what does the # signify? Are there more?

那么#表示什么?还有更多吗?

I know you can put some basic logic and function calls in there but I've never found anything that really describes how that can be used and should be used.

我知道你可以在那里放一些基本的逻辑和函数调用,但我从来没有找到任何真正描述如何使用和应该使用的东西。

I hope this isn't a duplicate but it's really hard to search for <%#

我希望这不是重复,但搜索<%#真的很难

4 个解决方案

#1


They're also called bee-stings:
In ASP.Net, what is the difference between <%= and <%#

它们也被称为蜜蜂蜇:在ASP.Net中,<%=和<%#之间有什么区别?

#2


Server tags. They are called server tags.

服务器标签。它们被称为服务器标签。

Of course there are more.

当然还有更多。

<%= "string constant" %> - it will output a given string to the HTML output

<%=“string constant”%> - 它会将给定的字符串输出到HTML输出

<%= BO.Customer.GetName () %> - will do the same with the function that returns a string result

<%= BO.Customer.GetName()%> - 将对返回字符串结果的函数执行相同操作

<% RenderMyCoolControl %> - without the "=" character, it is supposed that your function will render something to the HTML output using Response.Write

<%RenderMyCoolControl%> - 没有“=”字符,假设您的函数将使用Response.Write向HTML输出呈现内容

Or you can use that directly: <% Response.Write ("string constant") %>

或者您可以直接使用它:<%Response.Write(“string constant”)%>

Hope that helps.

希望有所帮助。

#3


Used for Binding Expressions; such as Eval and Bind, most often found in data controls like GridView, Repeater, etc

用于绑定表达式;例如Eval和Bind,最常出现在GridView,Repeater等数据控件中

Are there more?

还有更多吗?

Take a look here:

看看这里:

Inline tags

#4


There's a fairly complete list here:

这里有一个相当完整的列表:

ASP.NET "special" tags

ASP.NET“特殊”标签

And as the accepted answer on there states, they are "Server Side Scripting Tags"

正如那里所接受的答案所述,它们是“服务器端脚本标签”

#1


They're also called bee-stings:
In ASP.Net, what is the difference between <%= and <%#

它们也被称为蜜蜂蜇:在ASP.Net中,<%=和<%#之间有什么区别?

#2


Server tags. They are called server tags.

服务器标签。它们被称为服务器标签。

Of course there are more.

当然还有更多。

<%= "string constant" %> - it will output a given string to the HTML output

<%=“string constant”%> - 它会将给定的字符串输出到HTML输出

<%= BO.Customer.GetName () %> - will do the same with the function that returns a string result

<%= BO.Customer.GetName()%> - 将对返回字符串结果的函数执行相同操作

<% RenderMyCoolControl %> - without the "=" character, it is supposed that your function will render something to the HTML output using Response.Write

<%RenderMyCoolControl%> - 没有“=”字符,假设您的函数将使用Response.Write向HTML输出呈现内容

Or you can use that directly: <% Response.Write ("string constant") %>

或者您可以直接使用它:<%Response.Write(“string constant”)%>

Hope that helps.

希望有所帮助。

#3


Used for Binding Expressions; such as Eval and Bind, most often found in data controls like GridView, Repeater, etc

用于绑定表达式;例如Eval和Bind,最常出现在GridView,Repeater等数据控件中

Are there more?

还有更多吗?

Take a look here:

看看这里:

Inline tags

#4


There's a fairly complete list here:

这里有一个相当完整的列表:

ASP.NET "special" tags

ASP.NET“特殊”标签

And as the accepted answer on there states, they are "Server Side Scripting Tags"

正如那里所接受的答案所述,它们是“服务器端脚本标签”