David
David

Reputation: 73554

Asp.Net - what is <%$?

I should know this by now, but I don't, and for some reason, I am not finding the answer on Google, so I thought I'd try here.

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

And I've seen <%# %> for databinding.

However, today I noticed something new, and even though I can see what it's doing, I am looking for the official documentation on this. In one of my web pages, I see

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

So what does <%$ %> do?

Upvotes: 3

Views: 203

Answers (3)

Joel Coehoorn
Joel Coehoorn

Reputation: 415620

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

In summary ,there are a several different 'bee-stings':

  • <%@ - Page/Control/Import/Register directive
  • <%$ - Resource access and Expression building
  • <%= - Explicit output to page, equivalent to <% Response.Write( ) %>
  • <%# - Data Binding. It can only used where databinding is supported, or at the page level if you call Page.DataBind() in your code-behind.
  • <%-- - Server-side comment block
  • <%: - Equivalent to <%=, but it also HTMLEncode()s the output.

Upvotes: 7

Joel Etherton
Joel Etherton

Reputation: 37533

It's markup used to evaluate expressions rather than code.

Upvotes: 0

Tomasz Jaskuλa
Tomasz Jaskuλa

Reputation: 16013

Used for expressions, not code; often seen with DataSources

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

Upvotes: 5

Related Questions