I am saving the user image in application domain file system. and the storing path in a database. I am getting the path in my User.PhotoPath property. I want to show the image on the page of this photopath . How do I show it?
I am using Asp.net MVC 2 + C#.
Provide the PhotoPath as a property on your viewmodel:
Controller:
View:
You could also pass the
Userentity directly to the view, but it’s not recommended to do that. But if you want to do it this way, then you have to change the view’s page directive accordingly: