1;#Deepak Kumar
Get User name:
new SPFieldLookupValue(properties.ListItem["Staff Member"].ToString()).LookupValue;
Get User ID:
new SPFieldLookupValue(properties.ListItem["Staff Member"].ToString()).LookupId;
Using Split fuction:
properties.ListItem["Staff Member"].ToString();
You are going to be returned their userID and username, so it will always be returned separated by ;#.
properties.ListItem["Staff Member"].ToString().split(";#")[1];
Get User name:
new SPFieldLookupValue(properties.ListItem["Staff Member"].ToString()).LookupValue;
Get User ID:
new SPFieldLookupValue(properties.ListItem["Staff Member"].ToString()).LookupId;
Using Split fuction:
properties.ListItem["Staff Member"].ToString();
You are going to be returned their userID and username, so it will always be returned separated by ;#.
properties.ListItem["Staff Member"].ToString().split(";#")[1];
No comments:
Post a Comment