Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Finally i got solution for this.</p> <p>` ======================================= <strong>MVC 3 Controller</strong></p> <pre><code>public ActionResult Get_Leave_IO_Pic(DetailsModel model) { TCSServiceReference.MBLServiceSoapClient TCSClient = new TCSServiceReference.MBLServiceSoapClient(); DataSet ds = new DataSet(); DataSet resultds = TCSClient.Get_Employee_Details_Srno(ds, model.EMPSRNO); string strJSON = "Failed"; if (resultds.Tables[0] != null &amp;&amp; resultds.Tables[0].Rows.Count &gt; 0) { byte[] byteArrayIn = (byte[])resultds.Tables[0].Rows[0]["EMPPHOT"]; string EmpName = resultds.Tables[0].Rows[0]["EMPNAME"].ToString(); MemoryStream ms = new MemoryStream(byteArrayIn); Image gotimage = Image.FromStream(ms); string filepath = (System.Configuration.ConfigurationManager.AppSettings.Get("ImageUpload")).ToString(); //filepath = E:/Project/project1/Project1 MVC/Images/ gotimage.Save(filepath + EmpName + " - " + model.EMPSRNO + ".png"); strJSON = System.Configuration.ConfigurationManager.AppSettings.Get("ImageURL").ToString() + EmpName + " - " + model.EMPSRNO + ".png"; //ImageURL = http://localhost:8085/Project1MVC/Images/ } return Json(new { result = strJSON }); } </code></pre> <p>` ======================================= <strong>HTML</strong></p> <pre><code> &lt;img src="../images/bis_user.png" width="113" height="104" border="0" alt="" id="ImageStaff" /&gt; </code></pre> <p>` ======================================= <strong>jQuery</strong></p> <pre><code>function GetLeaveIOPic(empsrno) { $.post("http://localhost:8085/Project1MVC/Details/Get_Leave_IO_Pic", { EMPSRNO: empsrno }, function (data) { $.each(data, function (key, value) { if (!(data.result == 'Failed')) { // data.result = http://localhost:8085/Project1MVC/Images/name - 23.png $('#ImageStaff').attr('src', data.result.toString()); } }); }, 'json' ); } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload