Technokrat
Programmer
I have a datagrid with a templated field that looks like the following:
In the handler, it runs a query to see if the employee is available, or unavailable for work and the desired result should be the display of the proper image
This isn't working. Is there a way to return the image URL from the handler, or do I have to load and display the image from within the handler?
Code:
<asp:TemplateField HeaderText="Sunday">
<ItemTemplate>
<asp:Image ID="Image1" runat="server"
ImageUrl='<%# "AvailabilityButtonHandler.ashx?EmployeeId=1&DOW=0&ID=" + Eval("Sunday")%>' />
</ItemTemplate>
</asp:TemplateField>
In the handler, it runs a query to see if the employee is available, or unavailable for work and the desired result should be the display of the proper image
Code:
if((Int32)cmd.ExecuteScalar() != 0)
context.Response.Write("icoUnAvailable.png");
else
context.Response.Write("icoAvailable.png");
This isn't working. Is there a way to return the image URL from the handler, or do I have to load and display the image from within the handler?