I am trying to split fullname into firstname and lastname using the following:
but I am getting following error message:
'object' does not contain a definition for 'Substring' and no extension method 'Substring' accepting a first argument of type 'object' could be found (are you missing a using directive or an assembly reference?)
Any ideas?
Thank you
<asp:Label ID="lblPurchOnwer" Text='<%#Eval("buyername") %>' Style="width: 450px; color: #0093B2; font-weight: bold;" runat="server"></asp:Label> C# var Buyernames = Eval("buyername"); var bFName = Buyernames.Substring(0, Buyernames.IndexOf(" ")); var bLName = Buyernames.Substring(Buyernames.IndexOf(" ") + 1);
but I am getting following error message:
'object' does not contain a definition for 'Substring' and no extension method 'Substring' accepting a first argument of type 'object' could be found (are you missing a using directive or an assembly reference?)
Any ideas?
Thank you