Asp.Net - what is <% $?

I should know this until now, but I don’t do it, and for some reason I can’t find an answer on Google, so I decided to try it here.

I know that <%= %> is the equivalent of Response.Write()

And I saw <%# %> for data binding.

However, today I noticed something new, and although I see what he is doing, I am looking for official documentation on this issue. On one of my web pages I see

 ConnectionString="<%$ ConnectionStrings:SomeConnectionString %>" 

So what does <%$ %> do?

+3
source share
3 answers

Used for expressions, not for code; common with DataSources

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

+5
source

See this question:
In ASP.Net, what's the difference between <% = and <% #

Thus, there are several different "bee stings":

  • <%@ - Page / Management / Import / Register directive
  • <%$ - Access resources and create expressions
  • <%= - Explicit page output equivalent to <% Response.Write( ) %>
  • <%# - data binding. It can only be used where data binding is supported or at the page level if you call Page.DataBind() in your code.
  • <% - - server side comment block
  • <%: - equivalent to <%= , but also HTMLEncode () s output .
+7
source

This markup is used to evaluate expressions, not code.

0
source

All Articles