EasyUI 读数据库图

EasyUI 读数据库图

      function edit_dg() {
            //选中一行,获取这一行的主键值
            var idImg = $("#tbDeviceClassBrowstab").datagrid('getSelected').pid;
             $("#imgId").attr("src", "/ashx/Device/tbDeviceClass.ashx?action=image&pid=" + idImg);
     <td style=" padding:5px; " colspan="1" rowspan="8" >
                      <img id="imgId" alt="图片" border=0 align="middle"  src=""  width="200" height="200"> </img>
                   </td>

后台:

                byte[] imagebytes = null;
                imagebytes = (byte[])dtimg.Rows[0]["DevImage"];
                HttpContext.Current.Response.ContentType = "image/jpeg";
                HttpContext.Current.Response.BinaryWrite(imagebytes);

 

posted @ 2016-10-20 00:13  一枚水  阅读(734)  评论(0编辑  收藏  举报