i'm building a simple reporting applications , in which user has notifications i want to check if the notification is unRead i'll display a read image icon and if it was read , i'll display Read Icon
ive created a TicketIsUnRead() function to check if the ticket was read|unread
and i've used this code in aspx page that attaches different resource to the asp:image control different resources are responsible for changing the ImageUrl attribute
<asp:Image runat="server" id="ticketIcon" meta:resourcekey='<% (TicketIsUnRead(ticketNumberField.ToString()))? "UnReadticketIconResource" :"ReadticketIconResource"%>' />
and inside the Resx page
UnReadticketIconResource.ImageUrl images/UnReadMail.png
ReadticketIconResource.ImageUrl images/ReadMail.png
it seems that the Meta:resourcekey attribute doesn't allow the <% %> code
it returns parse error exception
Parser Error Message: '<% (TicketIsUnRead(ticketNumberField.ToString()))? "UnReadticketIconResource" :"ReadticketIconResource"%>' is not a valid resource key.