What <#
this symbol means in the asp.net
It is inside the html tag.
<td><#= userInfo.observerResponseKey != null ? (userInfo.observerStatus == '<%= Enum.GetName(typeof(Status), Status.Draft) %>' ? "Draft shared " + userInfo.observerDateSubmittedString : userInfo.observerStatus == '<%= Enum.GetName(typeof(Status), Status.Private) %>' ? "In Progress" : "Completed " + userInfo.observerDateSubmittedString) + " by " + userInfo.observerName : "Not Started" #></td>
I want to add img to the td if the result is "In progress" or "completed".
I tried adding like
<td><#= userInfo.observerResponseKey != null ? (userInfo.observerStatus == '<%= Enum.GetName(typeof(Status), Status.Draft) %>' ? "Draft shared " + userInfo.observerDateSubmittedString : userInfo.observerStatus == '<%= Enum.GetName(typeof(Status), Status.Private) %>' ? "In Progress" : "Completed " + userInfo.observerDateSubmittedString) + " by " + userInfo.observerName #><img src="../../images/icon_delete_red.png" /> <#= : "Not Started" #></td>
But its throwing error "Unparse Microtemplate"
So, what is that tag <#= mean? and how can I add an image in this code?
Please help me..
It's a code block or a "code nugget". Essentially it allows you to embed code to be processed and rendered by the server before being sent to the client.
See this .NET "code nugget blocks"?
or
What are these called in ASP.NET <%: %>?
An example :