Insert the Image in Grid View using Image Field

   WE HAVE A DATABASE TABLE (ADDHAR) WITH COLUMNS (ID,NAME,ADDRESS).  



Now, We have to insert the image field in the grid view- 

STEPS-

select the gridview > mastertag > edit columns  > select image field > set properties  

 

File Upload Coding[Upload Button]-

FileUpload1.FileName(Server.MapPath("~") + "//pics(folder_name)//" + FileUpload1.FileName );

Image1.ImageUrl = "~/pics(folder_name)/" +FileUpload1.FileName;

Label1.Text = FileUpload1.FileName;

Image Field-  



Image field has Two major properties- 

1. DataImageUrlField - Set the data base column name as same as it was given in the data base (status) 

2. DataImageUrlFormatString - Set the path of the folder where the image is stored through File upload control (pics)

~/folder_name/{0} 

{0}- it symbolises the finder will start finding from beginning. 


Output:- 






Comments

Popular posts from this blog

Parameter Query

Final Project

Grid View Paging