In ASP.NET 4.0
should use new syntax <%: expression %>or 2.0<%= HttpUtility.HtmlEncode(expression) %>
<%: expression %>
<%= HttpUtility.HtmlEncode(expression) %>
Less keystrokes, less likely to make a mistake, easier to read => use the first option.
A similar question if you want to do this:
<%= DateTime.Now %>
or
<% Response.Write(DateTime.Now) %>
There is no right answer, but, of course, it seems to me better.
Source: https://habr.com/ru/post/1720804/More articles:CSS issues - 960.gs - htmlДобавление некоторой логики в SQL-запрос - sqlhttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1720801/c-features-to-learn&usg=ALkJrhi7__PK-lY5TAZbR7SMzBDauc8XcASSL without HTTP - sslCan I use the static (i.e. Predefined) name of the callback function when requesting JSONP using jQuery? - javascriptHow to make trasanction cover multiple stored procedures? - sql-serverHow do you convert audio files (on the fly) to a browser? - linuxjQuery hosted on Google CDN: why do I need internet access? - jquerymysql: export single row but with all dependencies - sqlLinq Join - Duplicates - c #All Articles