In ascx file - code in front
<asp:Label ID="lblKPIStatus" Text='<%# ((int)AchievementQualityMark.AQMFunctions.funcGetEvidence_Status((int)AchievementQualityMark.AQMFunctions.funcGetEvidence_ID(Convert.ToInt32((string)hdnAuditID.Value), Convert.ToInt32((string)hdnKPIID.Value), (int)Eval("eviID"))))%> ' runat="server" />
This produces values 0 1 2 3 based on the result from a drop down menu
I'm trying to set the text value of an asp label to display different text messages based on the different numeric values produced by the function
funcGetEvidenceStatus
if I include the function in the code in front I get the right numbers but when I try to alter from the code behind I have problems with the
Eval
statement
(int)Eval("eviID")
any ideas how I can eliminate the
Eval
from the code behind
In Code Behind
if (((int)AchievementQualityMark.AQMFunctions.funcGetEvidence_Status((int)AchievementQualityMark.AQMFunctions.funcGetEvidence_ID(Convert.ToInt32((string)hdnAuditID.Value), Convert.ToInt32((string)hdnKPIID.Value), (int)Eval("eviID")))) == 0)
{
lblKPIStatus.Text = "None";
}
if (((int)AchievementQualityMark.AQMFunctions.funcGetEvidence_Status((int)AchievementQualityMark.AQMFunctions.funcGetEvidence_ID(Convert.ToInt32((string)hdnAuditID.Value), Convert.ToInt32((string)hdnKPIID.Value), (int)Eval("eviID")))) == 1)
{
lblKPIStatus.Text = "Not In Place";
}
if (((int)AchievementQualityMark.AQMFunctions.funcGetEvidence_Status((int)AchievementQualityMark.AQMFunctions.funcGetEvidence_ID(Convert.ToInt32((string)hdnAuditID.Value), Convert.ToInt32((string)hdnKPIID.Value), (int)Eval("eviID")))) == 2)
{
lblKPIStatus.Text = "Partly In Place";
}
if (((int)AchievementQualityMark.AQMFunctions.funcGetEvidence_Status((int)AchievementQualityMark.AQMFunctions.funcGetEvidence_ID(Convert.ToInt32((string)hdnAuditID.Value), Convert.ToInt32((string)hdnKPIID.Value), (int)Eval("eviID")))) == 3)
{
lblKPIStatus.Text = "Fully In Place";
}
I've tried DataItem and Container.DataItem but no joy - any ideas? I'm new to C# better with VB!