{"id":185,"date":"2009-07-07T14:33:17","date_gmt":"2009-07-07T19:33:17","guid":{"rendered":"http:\/\/hoolihan.net\/blog-tim\/?p=185"},"modified":"2009-07-07T14:40:46","modified_gmt":"2009-07-07T19:40:46","slug":"asp-net-comments","status":"publish","type":"post","link":"http:\/\/hoolihan.net\/blog-tim\/2009\/07\/07\/asp-net-comments\/","title":{"rendered":"ASP.Net Comments"},"content":{"rendered":"<p>Here&#8217;s a strange one I&#8217;ve never run into.  I was recently helping a developer figure out why some controls were not binding and showing on the page.  <\/p>\n<p>I noticed they were using html style comments in their page around some controls instead of .net style comments.  This was the problem.  Server side code still runs, and controls still render inside of html comments.  No harm in that, right?  The controls can&#8217;t do anything because they are in comments. <\/p>\n<p>Wrong.  These were validation controls.  They added javascript events to the page.  Those javascript events expected dom elements that didn&#8217;t exist.  <\/p>\n<p>You can argue that this shouldn&#8217;t have come up in the first place, as I think most ASP.Net developers know to use server side comments, however, I thought the result was interesting.  <\/p>\n<p>Also, it was interesting to note that if you had some boiler plate comment you wanted in your source, you could use asp to deliver the content&#8230;<\/p>\n<pre>\r\n    &lt;!-- \r\n      #both of these are valid\r\n      #response.write version\r\n    &lt;%=Resources.Resource1.Copyright%&gt;\r\n     \r\n     #or server control\r\n     &lt;asp:Literal Id=\"ltlCopyright\" Text='&lt;$Resource: Resources1, Copyright &gt;' \r\n                                      Runat=\"server\" \/&gt;\r\n    --&gt;<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Here&#8217;s a strange one I&#8217;ve never run into. I was recently helping a developer figure out why some controls were not binding and showing on the page. I noticed they were using html style comments in their page around some controls instead of .net style comments. This was the problem. Server side code still runs, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[82,69],"class_list":["post-185","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-asp-net","tag-linkedin"],"_links":{"self":[{"href":"http:\/\/hoolihan.net\/blog-tim\/wp-json\/wp\/v2\/posts\/185","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/hoolihan.net\/blog-tim\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/hoolihan.net\/blog-tim\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/hoolihan.net\/blog-tim\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/hoolihan.net\/blog-tim\/wp-json\/wp\/v2\/comments?post=185"}],"version-history":[{"count":0,"href":"http:\/\/hoolihan.net\/blog-tim\/wp-json\/wp\/v2\/posts\/185\/revisions"}],"wp:attachment":[{"href":"http:\/\/hoolihan.net\/blog-tim\/wp-json\/wp\/v2\/media?parent=185"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/hoolihan.net\/blog-tim\/wp-json\/wp\/v2\/categories?post=185"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/hoolihan.net\/blog-tim\/wp-json\/wp\/v2\/tags?post=185"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}