I want to add the images to the MVC project for datagrid!
I want to add the images to the MVC project for datagrid!
karunakh
Posts: 12Questions: 2Answers: 0
I want to add the images to my MVC gridview project.
Please reply ASAP!
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
I'm not clear on how this relates to DataTables - could you clarify that please?
Allan
I am using datatables in my asp.net project with MVC framework, i have already done the responsive, pagination, searching, sorting and so on features but I also want to add photos that are already present in the database.Please reply if you need more information i can provide you.
In what way are the photos in the database? Binary blobs or a text path to the image on the server? How do you normally view the images?
Allan
I am using Binary Blobs
Okay, so its still not really a DataTables question. How would you normally get them out of the database for display in a browser (e.g. how would you do it without DataTables)? You'll probably need to have a script on your server-side that you sent an image id to, it will read the binary from the database and then feed it back to the client-side.
Allan
Hi, allan
I am working on responsive grid using datatables and that is based on MVC , I am using
"render": function (data, type, JsonResultRow, meta) {
return '<img src="Content/images' + JsonResultRow.ImageAddress + '">';
to retrive the photos that are already in my database( and I am working with the existing database in my company so, firstly they made a grid that was jqgrid and now the database is same but I am just adding that with ADO entity in the MVC project)
but not getting anything, and this is the last step so, I need your help.
so, far I follow this tutorial, if that helps you to understand my question:
https://www.youtube.com/watch?v=2HliDQ4bfIA
Please reply.
What does that result in? What is
JsonResultRow.ImageAddress
?ImageAddress
may be this is not right code which I am using
result shows noting but disturbs my whole code the grid stopped working when i put these lines in
If you link to the page I would be happy to take a look and help to debug it.
Allan
I wish I could post that code for you but can you please tell me is there any way to add the images from sql database to the MVC project.
Assuming you have a URL to the image you can use
columns.render
:If it isn't a URL to the image, then I don't know what it is and can't help without a test case.
Allan
thanks Allan it worked.