Public Function dealphotocut1(ByVal a As String) As String
If a.Length >= 18 Then
Dim str As String = a
Dim str1, str2 As String
Dim str3 As String = ""
str1 = str.Substring(0, 11)
str2 = str.Substring(11, 7)
If str1 = "Invoice No:" Then
str3 = "<a href='View_Invoice.aspx?CInvoiceNo=" & str2 & "' Target='_blank'>Invoice No:" & str2 & "</a>"
Return str3
End If
Else
Return a
End If
End Function
<asp:TemplateField HeaderText="Cash Description">
<ItemTemplate>
<asp:Label ID="Label37" runat="server" Text='<%# dealphotocut1(Eval("Cash_Description"))%>'></asp:Label>
</ItemTemplate>
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>