Pheonix2105 wrote:
Yes, I checked the variable and it's ok. Converting is right. The variable(userID) always have a value.
- Is the code to return the providerUserID functioning correctly? (Does it return a valid ID everytime?)
- You could also try Convert.ToInt64() instead of long.Parse() - I believe they both return the same though so It may not matter.
- The only reason I can think of what with what I've seen of your code is when you refresh the page the variable providerUserID is being unset on refresh.
var userID = Convert.ToInt64(providerUserID);
var user = User.GetUserFromId(userID);
if (user != null)
{
return user.ProfileImageUrl;
}