i has a relative image path as
~/image/noimage.jpg
I need to read an array of bytes to be stored in the database if the logo of this organization is not in db
public byte[] org_logo(int myOrgId) { byte[] photo ; var context = new mp_repositoryEntities(); var query = from o in context.organizations where o.organization_id == myOrgId select o.logo; photo = query.FirstOrDefault<byte[]>(); if (photo == null) { photo = File.ReadAllBytes("~/image/noimage.jpg"); } return photo; }
when i set this path in asp control then it works fine.
logo.ImageUrl = "~/image/noimage.jpg";
any idea ?????
syed Ahsan Jaffri
source share