Introduction:-
in this Example we Explain that How to Insert Update Image in MVC in asp.net in grid view.
Description:-
We can Edit the Image same as we
done in C#.Net but Here we have to manage each code in Diiferant File.Look at
the Following Code in which we can Bind the Image in Gridview usind asp code in
Html Design Form.
For Ex:-
<input type="file" name="file" id="file" /> <%
Response.Write("<img src='../../Content/"+Model.photo+"' alt='ii'
width='80'
height='80' />");
%>
Look at the above
Example we Fetch the Image path like (Model.photo) From the database and Displa are Displaying it
Using Create a <img> tag with src Element and displaying Image at
runtime. So it is very difficult task then as simple display in gridview in
asp.net with c#.
Look also <%=Html.ActionLink("Back
to List",
"Index") %> this will Automatically Create a Link to the
HomePage.
Look the Following code for Fetch Image FileName
QuestionModelDataContext qDB = new QuestionModelDataContext();
var m = qDB.demoimages.First(p => p.id == id);
m.name = collection["name"].ToString();
m.photo = posted.FileName;
to show Example of Insert,Update,Delete in MOdalPopup ModalPopup for CRUD operation
Export Gridview data to PDF file Export Gridview Row to PDF