Sk Jha

Sk Jha

  • NA
  • 113
  • 43.4k

set image extension dynamically either .png or .jpg

Dec 13 2017 12:58 PM
how to set image extension dynamically either .png or .jpg because i have only image name in my database without extension in asp.net and in my folder there are .png and .jpg both files are available?
------------------------------------------------------------------------
the code which i am trying to set but if the particular file extension is not matched then how can i change .png to .jpg.
image.Src = "../image_data/" + dr["DesignNo"].ToString()+".png";

Answers (2)