Powiel możliwe:
What's the difference between <%# %> and <%= %>?
<%$, <%@, <%=, <%# … what's the deal?Jaka jest różnica między <%: a <% = i <% # w aspxie?
Przepraszam jeśli ten jest powielany, ale irytująco trudne do google.
Powiel możliwe:
What's the difference between <%# %> and <%= %>?
<%$, <%@, <%=, <%# … what's the deal?Jaka jest różnica między <%: a <% = i <% # w aspxie?
Przepraszam jeśli ten jest powielany, ale irytująco trudne do google.
<%:
jest nowością w .NET 4.0 - jest to odpowiednik HttpUtility.HtmlEncode(Response.Write())
.
<%=
jest starsza i oznacza tylko Response.Write()
.
<%#
to binding expression.
Here's dobry artykuł na ich temat. W skrócie:
dyrektywy Page
<%@ Page Language="C#" %>
renderowania kodu
<% Response.Write("Hello World!"); %>
<%= SayHello("Ahmed") %>
<%: DateTime.Now.ToString() %>
Expression Składnia
<%$ ConnectionStrings:ConnStrFromWebConfig %>
<%$ AppSettings:ValueFromWebConfig %>
<%$ Resources:Resource, Arabic %>
<%$ RouteValue:year %>
<%$ YourExpressionPrefix : Any %>
Wiązanie danych Składnia
<%# Eval("Name") %>
<%# Bind("Name") %>
<%# XPath ("Name") %>
Komentarz Server
<%-- <asp:Label runat="server" Text="Label"></asp:Label>-- %>
także http://stackoverflow.com/questions/197047/what-is-the-difference-between-and – Oded
i http://stackoverflow.com/questions/160097/whats -różnica-między-i kilka innych –
Wiwaty, szkoda, że nie możesz wyszukać <% przy użyciu wyszukiwania ... nawet lista sugestii nie zawierała ich. Jak do cholery je znalazłeś? :) Będę zamknąć jako dupe – NibblyPig