i want to show/hide a table row with using DateTime.Now.Month in html codes but i couldn’t remember the correct syntax. What i mean is above, but not working in this way. What is the correct syntax? Thanks in advance
<tr style='<%# DateTime.Now.Month==11? "display:none": "display:inline"%>' ></tr>
Asp tags come in a variety of flavors. The code you’ve written is correct but because you’re using the wrong asp tags, nothing shows up.
This is the tag you want to use:
<%= %>most useful for displaying single pieces of informationThis is the tag you’re currently using:
<%# %>Data Binding Expression SyntaxThis doesn’t work because you’re not using data binding, you’re just echoing a string.
More info here: http://forums.asp.net/p/1139381/1828702.aspx
and here http://msdn.microsoft.com/en-us/library/6dwsdcf5.aspx