Kindly i have Contacts RadGrid, one of the columns is A template which has Image control to show contact photo saved in the database as Binary....
while binding data to this grid i use the following code to set the image url propertry,
imageControl.ImageURL = "~/ShowContactPhoto.ashx?ContactID=10";
and this is the code in this page:
public class ShowContactPhoto : IHttpHandler
{
public void ProcessRequest(HttpContext context)
{
int iContactID = Convert.ToInt32(context.Request.QueryString["ContactID"]);
Stream strm = showContactImage(iContactID);
byte[] buffer = new byte[4096];
int byteSeq = strm.Read(buffer, 0, 4096);
while (byteSeq > 0)
{
context.Response.OutputStream.Write(buffer, 0, byteSeq);
byteSeq = strm.Read(buffer, 0, 4096);
}
}
public Stream showContactImage(int iContactID)
{
Individual_Contacts_BLL bllContact = new Individual_Contacts_BLL();
Individual_Contacts_BO boContact = new Individual_Contacts_BO();
boContact.Contact_ID = iContactID;
DataTable dt = bllContact.selectContactPhoto(ref boContact);
object img = dt.Rows[0]["Contact_Photo"];
try
{
return new MemoryStream((byte[])img);
}
catch
{
return null;
}
// return null;
}
public bool IsReusable
{
get
{
return false;
}
}
}
Also, user can edit contact information, and also in the photo, i do the edit in another page opened in a Radwindow....all is fine and all the data is updated in database even the image, i call the grid rebind via an ajax request and also the grud is refreshed...BUT, neither the image control in the edit window page and the cloumn in the radgrid is refreshed until i call the page again!!!!
i debug the code, and the ImageURL is rewritten but the ShowContactPhoto.ashx is not called again until i call the whole page which holds the grid again!!!
i tried to send a random number within the url so not called from the cash,,, but still not called!!!
how can i acheive this, i need to show the updated image in the edit window and the grid without the need to call the page again!!!
any help will be geat...
thanks
asa'ad