c# - ASP.NET <%# versus <% -


i'm working on various asp.net pages .

for inline functions see 2 different formats used:

example 1:

<p><%response.write(now())%></p> 

i see 1 #:

example 2:

<asp:textbox id="textbox5" width="40" text='<%# databinder.eval(container.dataitem, "name") %>' runat="server" /> 

i want know exact different , <%# vs <%

here explanation here on stack -

in asp.net, difference between <%= , <%# [duplicate]

summary answers:

there several different 'bee-stings':

  • <%@ - page/control/import/register directive
  • <%$ - resource access , expression building
  • <%= - explicit output page, equivalent <% response.write( ) %>
  • <%# - data binding. can used databinding supported, or @ page level if call
  • page.databind() in code-behind.
  • <%-- - server-side comment block
  • <%: - equivalent <%=, html-encodes output.

Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -