我有一个转发器控件,其中包含与员工相关的各种标签。标签是从数据库中填充的。我想知道例如如何更改一行的值。如果lblChestResults =“ False”,则lblChestResults =“异常”。
以下是我的中继器控件:
<asp:Repeater ID="RepeaterEmployee" runat="server" OnItemCommand="RepeaterEmployee_ItemCommand1">
<ItemTemplate>
<table runat="server" class="table table-default table-striped table-bordered table-condensed">
<tr><td colspan="2" style="text-align:center;" ><asp:Image ID="Image1" runat="server" ImageAlign="Middle" ImageUrl='<%# Eval("Photo") %>' /></td></tr>
<tr>
<td style="vertical-align:middle;">
<%--<asp:Image ID="EmployeePhoto" runat="server" ImageAlign="AbsMiddle" ImageUrl='<%# Eval("Photo") %>' />--%>
</td>
<td>
<table runat="server" style="width:100%;">
<tr>
<td><b>First Name:</b></td>
<td><asp:Label ID="FirstName" runat="server" Text='<%#Eval("FirstName") %>'></asp:Label></td>
</tr>
<tr>
<td><b>Last Name:</b></td>
<td><asp:Label ID="lblLastName" runat="server" Text='<%#Eval("LastName") %>'></asp:Label></td>
</tr>
<tr>
<td><b>Employee Code:</b></td>
<td><asp:Label ID="lblCode" runat="server" Text='<%#Eval("Code") %>'></asp:Label></td>
</tr>
<tr>
<td><b>ID:</b></td>
<td><asp:Label ID="lblEmployeeID" runat="server" Text='<%#Eval("EmployeeID") %>'></asp:Label></td>
</tr>
<tr>
<td><b>Chest Results:</b></td>
<td><asp:Label ID="lblChestResults" runat="server" Text='<%#Eval("ChestResults") %>'></asp:Label></td>
</tr>
<tr>
<td><b>ECG Result:</b></td>
<td><asp:Label ID="lblECGResult" runat="server" Text='<%#Eval("ECGResult") %>'></asp:Label></td>
</tr>
<tr>
<td><b>Blood Glucose Result:</b></td>
<td><asp:Label ID="lblBloodGlucoseResult" runat="server" Text='<%#Eval("BloodGlucoseResult") %>'></asp:Label></td>
</tr>
<tr>
<td><b>GGT Result:</b></td>
<td><asp:Label ID="lblGGTResult" runat="server" Text='<%#Eval("GGTResult") %>'></asp:Label></td>
</tr>
<tr>
<td><b>Medical Report:</b></td>
<td>
<%--<a href="/images/myw3schoolsimage.jpg" ID="LinkButton1" runat="server" target="_blank">download</a>--%>
<%-- <asp:LinkButton ID="LinkButton1" runat="server" OnCommand="LinkButton1_Command" OnDataBinding="LinkButton1_DataBinding" OnClick="LinkButton1_Click" CommandArgument='<%# Eval("Certificate") %>' CommandName="download">Download</asp:LinkButton>--%>
<asp:LinkButton ID="btnDownload" Text="Download Medical Report" OnClick="btnDownload_Click" CommandName="Download" CommandArgument='<%#Eval("MedicalCertificateID") %>' runat="server"></asp:LinkButton>
</td>
</tr>
</table>
</td>
</tr>
</table>
</ItemTemplate>
</asp:Repeater>