I am attempting to convert an existing WinForms application to a MVC Web Application.
I am attempting to display an image from a controller.
At the moment I get a System.Drawing.Image back from a function and I am trying to work out how to supply this to the View.
This is my controller:
public System.Drawing.Image getStudentImage(string PersonID)
{
System.Drawing.Image studentImage = ClientFunctions.GetStudentImage(GlobalVariables.networkstuff, GlobalVariables.testAuth, PersonID);
return studentImage;
}
And then, in my View I would like to display this image...
Hopefully, like this:
<img id="@pupil.PupilInfo.PersonID" src="~/TakeRegister/getStudentImage/@pupil.PupilInfo.PersonID" alt="" />
When I run the code I get broken images in the browser and when I look at the "src" of the image it looks like this:
http://localhost:19340/TakeRegister/getStudentImage/3058
I get the feeling I am doing more than 1 thing wrong here... (?)
Can anyone give me any pointers please?