Click here to Skip to main content
16,018,534 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
when the user logs in i want to show his profile pic,but in database i am only storing the path of that image not the actual image ,so how can i add profile pic after login.

What I have tried:

C#
imgPofilePic.ImageUrl = Convert.ToString(Session["ProfilePic"]);
Posted
Updated 9-Nov-16 1:18am
Comments
[no name] 8-Nov-16 8:40am    
It would appear that you forgot to ask a question or describe a problem with your "code". What would you expect anyone to able to tell you from one single line of code?
Member 12749751 8-Nov-16 8:43am    
actually i am not getting any idea about this so please help me
F-ES Sitecore 8-Nov-16 9:38am    
What you've got should work assuming the Session["ProfilePic"] is a valid url to the file. If your code "isn't working" then Session["ProfilePic"] isn't a valid path and there is no way anyone here could tell you why. Do some debugging and at least find out what that Session variable holds as you're probably mixing file paths with http paths when the two are not the same.
[no name] 8-Nov-16 9:53am    
Well since you don't have an actual question or a problem then do it just like you are.

1 solution

Many people often store the path to the image in the database. So, all you do is create an image and set the src to be the url of the image. Pretty simple.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900