I want to set image.imageurl dinamically... But the code bellow just works when the page is not on a masterpage.
Here is the code:
protected void AsyncFileUpload1_UploadedComplete(object sender, AjaxControlToolkit.AsyncFileUploadEventArgs e)
{
Byte[] bytes = AsyncFileUpload1.FileBytes;
string base64String = Convert.ToBase64String(bytes, 0, bytes.Length);
ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "img",
"top.document.getElementById('Image1').src='data:image/jpg;base64," + base64String + "';",
true);
}