check response.contenttype = "application/pdf", did you set the proper content type? does your client have Adobe Acrobat Reader installed?Response.Clear();
Response.ContentType=dr["personimagetype"].Tostring();
Response.Addheader("Content-Disposition", "inline; filename=ado.pdf");
byte[] bs = (byte[]) dr["personimage"];
Response.AddHeader("Content-Length", bs.Length.ToString());
Response.BinaryWrite(bs);
Response.End();

解决方案 »

  1.   

    如果是pdf,就用<object classid="clsid:CA8A9780-280D-11CF-A24D-444553540000" width="760" height="411" border="0"> 
          <param name="_Version" value="65539"> 
          <param name="_ExtentX" value="20108"> 
          <param name="_ExtentY" value="10866"> 
          <param name="_StockProps" value="0"> 
          <param name="SRC" value="illustrator.pdf"> 
    </object> 
      

  2.   

    to saucer:
    这段代码有点问题!
    提示说Addheader没定义之类的!
    另外我想问的是:ado.pdf是?
    Response.Addheader("Content-Disposition", "inline; filename=ado.pdf");
    Response.AddHeader("Content-Length", bs.Length.ToString());
    这两语句是什么意思,谢谢
    思归兄弟!
      

  3.   

    To net_lover:
    你的这段代码我怎么看不懂啊
    解释解释!
      

  4.   

    Content-Disposition用来说明Response的内容是独立的附件还是inline
    Content-Length定义Http Response的内容的长度Two common ways of presenting multipart electronic messages are as a
       main document with a list of separate attachments, and as a single
       document with the various parts expanded (displayed) inline. The
       display of an attachment is generally construed to require positive
       action on the part of the recipient, while inline message components
       are displayed automatically when the message is viewed. A mechanism
       is needed to allow the sender to transmit this sort of presentational
       information to the recipient; the Content-Disposition header provides
       this mechanism, allowing each component of a message to be tagged
       with an indication of its desired presentation semantics.
      

  5.   

    response.write("<script language='javascript'>window.open('abc.pdf','','')</script>")妳把abc.pdf修改為妳的變量名看看!