1
Reply

how to show all chacters of a string before the @ character

Cassie Mod

Cassie Mod

Jul 13 2017 6:13 AM
188
Hi ive got the following qustion.
 
I have a an asp.net gridview. and one colum contains the user. However all the users have a
certain const value at the end like @blabla wich i dont want to show in the gridview colum
so user was pietje@blabla and i want to show just pietje.
 
I have got the following itemtemplate to show the hole user, but how can i remove the chachagters after the '@' ??
 
This is what i got already.
 
  1. <asp:TemplateField HeaderText="Gebruiker" HeaderStyle-Width="30%" SortExpression="UserId">  
  2.     <ItemTemplate>  
  3.         <asp:Label ID="userLabel" runat="server" Text='<%#Eval("UserId").ToString()%>'></asp:Label>  
  4.     </ItemTemplate>  
  5. </asp:TemplateField>  

Answers (1)