{"id":304,"date":"2012-02-09T12:22:33","date_gmt":"2012-02-09T11:22:33","guid":{"rendered":"http:\/\/dev.flauschig.ch\/wordpress\/?p=304"},"modified":"2012-02-09T12:49:59","modified_gmt":"2012-02-09T11:49:59","slug":"inline-asp-net-markup-tags","status":"publish","type":"post","link":"http:\/\/dev.flauschig.ch\/wordpress\/?p=304","title":{"rendered":"Inline Asp.Net Markup Tags"},"content":{"rendered":"<p>Those tags are evaluated during the <strong>Render<\/strong> part of the page&#8217;s load cycle. See <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/d5bd1tad.aspx\">here<\/a> for more information.<\/p>\n<h2>Displaying (&lt;%= &#8230; %&gt;)<\/h2>\n<p>Displays the given value as a string.<\/p>\n<p><a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/6dwsdcf5(v=vs.100).aspx\">http:\/\/msdn.microsoft.com\/en-us\/library\/6dwsdcf5(v=vs.100).aspx<\/a><\/p>\n<h2>Displaying with Encoding (&lt;%: &#8230; %&gt;)<\/h2>\n<p>Displays the given value as string but <strong>HTML-Encodes<\/strong> it before.<\/p>\n<p>If you&#8217;re sure that the given string is already html-encoded, use it like this:<br \/>\n<code>&lt;%: new HtmlString(\"&lt;strong&gt;HTML that is not encoded&lt;\/strong&gt;\") %&gt;<code><br \/>\n<a href=\"http:\/\/weblogs.asp.net\/scottgu\/archive\/2010\/04\/06\/new-lt-gt-syntax-for-html-encoding-output-in-asp-net-4-and-asp-net-mvc-2.aspx\">http:\/\/weblogs.asp.net\/scottgu\/archive\/2010\/04\/06\/new-lt-gt-syntax-for-html-encoding-output-in-asp-net-4-and-asp-net-mvc-2.aspx<\/a><\/code><\/code><\/p>\n<h2>Data-Binding (&lt;%# &#8230; %&gt;)<\/h2>\n<p>Those are resolved when the <strong>DataBind<\/strong> method of the control or the page is called.<\/p>\n<p><a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms178366.aspx\">http:\/\/msdn.microsoft.com\/en-us\/library\/ms178366.aspx<\/a><\/p>\n<h2>Server-Side Comments (&lt;%&#8211; &#8230; &#8211;%&gt;)<\/h2>\n<p>Used to comment out code\/controls which then won&#8217;t be processed.<\/p>\n<p><a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/3207d0e3.aspx\">http:\/\/msdn.microsoft.com\/en-us\/library\/3207d0e3.aspx<\/a><\/p>\n<h2>Server-Side Includes (&lt;!&#8211; #include file|virtual=&#8221;filename&#8221; &#8211;&gt;)<\/h2>\n<p>Used to insert to content of a given file within the current position.<\/p>\n<p><a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/4acf8afk.aspx\">http:\/\/msdn.microsoft.com\/en-us\/library\/4acf8afk.aspx<\/a><\/p>\n<h2>Embedded Code Blocks (&lt;% &#8230; %&gt;)<\/h2>\n<p>Used to run some code without returning anything.<\/p>\n<p><a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms178135(v=vs.100).aspx\">http:\/\/msdn.microsoft.com\/en-us\/library\/ms178135(v=vs.100).aspx<\/a><\/p>\n<h2>Expressions (&lt;%$ &#8230; %&gt;)<\/h2>\n<p>Used for expressions instead of code.<\/p>\n<p><a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/d5bd1tad.aspx\">http:\/\/msdn.microsoft.com\/en-us\/library\/d5bd1tad.aspx<\/a><\/p>\n<h2>Directives (&lt;%@ &#8230; %&gt;)<\/h2>\n<p>Specifies settings for the page or imports and such.<\/p>\n<p><a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/xz702w3e(v=vs.100).aspx\">http:\/\/msdn.microsoft.com\/en-us\/library\/xz702w3e(v=vs.100).aspx<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Those tags are evaluated during the Render part of the page&#8217;s load cycle. See here for more information. Displaying (&lt;%= &#8230; %&gt;) Displays the given value as a string. http:\/\/msdn.microsoft.com\/en-us\/library\/6dwsdcf5(v=vs.100).aspx Displaying with Encoding (&lt;%: &#8230; %&gt;) Displays the given value as string but HTML-Encodes it before. If you&#8217;re sure that the given string is already &hellip; <\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[5,3],"tags":[],"class_list":{"0":"entry","1":"post","2":"publish","3":"author-roemer","4":"post-304","6":"format-standard","7":"category-asp","8":"category-programming"},"acf":[],"views":2338,"_links":{"self":[{"href":"http:\/\/dev.flauschig.ch\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/304"}],"collection":[{"href":"http:\/\/dev.flauschig.ch\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/dev.flauschig.ch\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/dev.flauschig.ch\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/dev.flauschig.ch\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=304"}],"version-history":[{"count":0,"href":"http:\/\/dev.flauschig.ch\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/304\/revisions"}],"wp:attachment":[{"href":"http:\/\/dev.flauschig.ch\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=304"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/dev.flauschig.ch\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=304"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/dev.flauschig.ch\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=304"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}