Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what does " <%: " do?

Tags:

asp.net

I have seen the following tag as an answer to a question:

<%: Model.FirstName %>

what does " <%: " do?

like image 250
ravisilva Avatar asked Sep 30 '12 15:09

ravisilva


People also ask

What is CFA useful for?

Widely considered the apex for professional development in investment management, the CFA designation is valued by employers for roles and functions in every sector of the global finance industry, including portfolio management, analysis, private wealth, and consulting.

Is it worth doing the CFA?

You never know what future the markets might hold for you, so the CFA Program offers a good base of knowledge to get you on your way.” The general consensus of most CFA charterholders is that it has paid off in terms of career, knowledge, satisfaction, and end results.

How much do CFA make?

As of May 2022, the average total compensation for charterholders (in the U.S.) is approximately $300,000, according to the CFA® Society. The median base salary for charterholders is approximately $180,000, which leaves the balance to be split between cash bonuses and equity or profit-sharing.


1 Answers

It html encodes the output of Firstname, this prevents encoding attacks like cross-side scripting (XSS).

Html encoded:

<%: Model.FirstName %>

Normal output:

<%= Model.FirstName %>

More info can by found at this blog post:

New <%: %> Syntax for HTML Encoding Output in ASP.NET 4 (and ASP.NET MVC 2)

like image 153
Erwin Avatar answered Nov 08 '22 20:11

Erwin