Just returned home from the Orlando Code Camp with my 3 children who were real troopers for joining me on the trip. We woke up at 4:30am for a 2+ hour drive so I could speak about What’s New in ASP.NET 4 at 8:30am.
I realized on my ride home that I neglected to mention Html Encoded Code Expressions as a new feature in ASP.NET 4. It was in my code and listed in the tutorials, but somehow in the excitement of mentioning the other ASP.NET 4 Features it got overlooked. Hence, I thought I would follow-up with a quick blog post to remedy the situation.
When you display data to a browser you will sometimes use the following code expression:
<%= data %>
If instead you were to use the new HTML Encoded Code Expression in ASP.NET 4, which replaces “=” with “:” as such:
<%: data %>
If you attended the Sarasota Web Developer Group, we went over this new ASP.NET 4 Feature in detail.
Hope this helps.