Hello all!

Below is my code to give you an idea as to what I would like to do.

Partial Class OLATool
    Inherits System.Web.UI.Page

    Protected Sub SqlDataSource1_Selecting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.SqlDataSourceSelectingEventArgs) Handles SqlDataSource1.Selecting

    End Sub


    Protected Sub OLATool_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    End Sub

End Class

Below is my .ASPX file

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="OLATool.aspx.vb" Inherits="OLATool" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <style type="text/css">
        .style1
        {
            font-family: Arial, Helvetica, sans-serif;
            font-size: small;
            color: #FF0000;
            font-weight: bold;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <span class="style1">Sub case #</span>
    <asp:TextBox ID="txtSubcaseNumber" runat="server"></asp:TextBox>
    
        <asp:DataList ID="DataList1" runat="server" DataKeyField="Owner" 
            DataSourceID="SqlDataSource1" 
            style="font-family: Arial, Helvetica, sans-serif; font-size: small">
            <ItemTemplate>
                Sub Case Owner:
                <asp:Label ID="OwnerLabel" runat="server" Text='<%# Eval("Owner") %>' />
                <br />
                Department:
                <asp:Label ID="DepartmentLabel" runat="server" 
                    Text='<%# Eval("Department") %>' />
                <br />
                Workgroup:
                <asp:Label ID="WorkgroupLabel" runat="server" Text='<%# Eval("Workgroup") %>' />
                <br />
                Product:
                <asp:Label ID="ProductLabel" runat="server" Text='<%# Eval("Product") %>' />
                <br />
                Priority:
                <asp:Label ID="PriorityLabel" runat="server" Text='<%# Eval("Priority") %>' />
                <br />
                Severity:
                <asp:Label ID="SeverityLabel" runat="server" Text='<%# Eval("Severity") %>' />
                <br />
                Created:
                <asp:Label ID="CreatedLabel" runat="server" Text='<%# Eval("Created") %>' />
                <br />
                Age:
                <asp:Label ID="AgeLabel" runat="server" Text='<%# Eval("Age") %>' />
                <br />
                Type:
                <asp:Label ID="typeLabel" runat="server" Text='<%# Eval("type") %>' />
                <br />
                SLA:
                <asp:Label ID="OLALabel" runat="server" Text='<%# Eval("OLA") %>' />
                <br />
                <br />
            </ItemTemplate>
        </asp:DataList>
    
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:CCTConnectionString %>" 
        SelectCommand="GetOLA" SelectCommandType="StoredProcedure">
        <SelectParameters>
            <asp:ControlParameter ControlID="txtSubcaseNumber" Name="SubcaseNumber" 
                PropertyName="Text" Type="String" />
        </SelectParameters>
    </asp:SqlDataSource>
 
    </form>
</body>
</html>

What I would like to do is, if AgeLabel is greater than OLALabel - have a message that says "In SLA" or "Out of SLA" If the AgeLabel is lower the OLA Label.
I figured this would be quick for one of you experts around here, Thanks!!

hi,

try like this

create a label below u r code

and display the message as follows

lblmsg.text='<%# (Eval("Age") >Eval("OLA") ) ? "In SLA" : "Out of SLA" %>'
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.