Problem displaying an image from a local folder on the server after page is loaded.
The image only shows when the page is refreshed.
I will like to display the image after the page has finish loading.
What can I do to solve this problem.
This is the code that loads the image.
string iconn = ConfigurationManager.AppSettings["cdconn"];
string sp = "stored_procedure_name";
SqlConnection cn = new SqlConnection(iconn);
SqlCommand cmd = new SqlCommand(sp , cn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@ID", cn);
cn.Open();
if(File.Exists(_fileName)) {
File.Copy(_fileName, _newFileName, true);
Image1.ImageUrl = _imageFolder + _id.ToString() + ".jpg";
} else {
Image1.Visible = false;
}
cn.Close();
...
Go to the complete details ...