Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET AJAX > BinaryImage > Error While Binding the Images

Not answered Error While Binding the Images

Feed from this thread
  • Posted on Sep 23, 2011 (permalink)

    Hi All,

    I am trying to fetch the images from database, if no images are available from the data base it is showing "DBNull' Error.

    If I write the following code snippet with in the binding value '<%#Eval(Picture):null?Null:Eval("Picture")%> then all the images which even have the content are not getting displayed as required. Please do help me out of this problem.

    Thanks,
    Syed Danish

    Reply

  • Posted on Sep 23, 2011 (permalink)

    Hello,

    please check with below code snippet.
    DataValue='<%# Eval("Picture") == null ? null : ((Binary) Eval("Picture")).ToArray() %>'

    or
    ImageUrl  = '<%# Eval("Picture") == null ? null : Eval("Picture") %>'

    let me know if any concern.

    Thanks,
    Jayesh Goyani

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET AJAX > BinaryImage > Error While Binding the Images