Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 496 Vote(s) - 3.47 Average
  • 1
  • 2
  • 3
  • 4
  • 5
<%$, <%@, <%=, <%# ... what's the deal?

#1
I've programmed in both classic ASP and ASP.NET, and I see different tags inside of the markup for server side code.

I've recently come across a [good blog on MSDN][1] that goes over the difference between:

- `<%=` (percentage together with equals sign) and
- `<%#` (percent sign and hash/pound/octothorpe)

(`<%#` is evaluated only at databind, and `<%=` is evaluated at render), but I also see:

- `<%$` (percent and dollar sign) and
- `<%@` (percent sign and at symbol).

I believe `<%@` loads things like assemblies and perhaps `<%$` loads things from config files? I'm not too sure.

I was just wondering if anyone could clarify all of this for me and possibly explain why it's important to create so many different tags that seemingly have a similar purpose?


[1]:

[To see links please register here]

Reply

#2
You've covered 2 of them (<%# is evaluated only at databind, and <%= is evaluated at render), and the answer for "`<%@`" is that it's compiler directives (ie., stuff like what you'd put on a compiler's command line).

I don't know about "`<%$`".
Reply

#3
- `<% %>` - is for [inline code](

[To see links please register here]

) (especially logic flow)
- `<%$ %>` - is for [evaluating expressions](

[To see links please register here]

) (like resource variables)
- `<%@ %>` - is for [Page directives](

[To see links please register here]

), registering assemblies, importing namespaces, etc.
- `<%= %>` - is short-hand for `Response.Write` (discussed [here](

[To see links please register here]

))
- `<%# %>` - is used for [data binding expressions](

[To see links please register here]

).
- `<%: %>` - is short-hand for [Response.Write(Server.HTMLEncode())][1] ASP.net 4.0+
- `<%#: %>` - is used for [data binding expressions](

[To see links please register here]

) and is automatically HTMLEncoded.
- `<%-- --%>` - is for [server-side comments](

[To see links please register here]

)


[1]:

[To see links please register here]

Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through