Monday, 19 May 2014

Serversite function in ClientSite

 <asp:TemplateField HeaderText="Action" ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left"
                                                            ItemStyle-Width="10%">
                                                            <ItemTemplate>
                                                                <asp:Label ID="lblDR_Action" runat="server" Text=' <%# GetLabelTextHistory(Eval("DR_Action"))%>'></asp:Label>
                                                            </ItemTemplate>
                                                        </asp:TemplateField>

Public Function GetLabelTextHistory(dataItem As Object) As String
        Dim text As String = ""
        Dim val As String = TryCast(dataItem, String)
        Select Case val
            Case "A"
                text = "Accept"
                Exit Select
            Case "R"
                text = "Reject"
                Exit Select
            Case "P"
                text = "Partly Accept"
                Exit Select
            Case "N"
                text = "Pending"
                Exit Select
                'Case Else
                '    text = "Pending"
                '    Exit Select

        End Select
        Return text
    End Function