Hi all,
To those who would be interested in the problem below
I would be grateful to those who could help me with the following problem:
I am utilizing DataList object to display data on my Web page.
Each item in the data list is displayed as plain text or a hyperlink
on the base of its status.
<template name="ItemTemplate">
<tr>
<%
string strStatus = DataBinder.Eval(Container.DataItem, "Status")
if (strStatus.CompareTo("change")){
%>
<td valign=top><a href="edit-item.aspx"><%#
DataBinder.Eval(Container.DataItem, "ItemName")%></a></td>
<% } else %>
<td valign=top><%# DataBinder.Eval(Container.DataItem,
"ItemName")%></td>
</tr>
</template>
However, perhaps the code 'DataBinder.Eval(Container.DataItem, "Status")'
is put into effect at the run-time so that
variable strStatus (which may be already put into effect) is assigned a null
rather than the value expected
and consequently, the above code become a dump.
Maybe I made a mistake somewhere or the code should be replaced with a
entirely new one ?
I was hoping to hear from you soon.
Thank you very much.
Quynh Nguyen