با سلام
من در بانك مشخصات شخص را در بانك ذخيره مي كنم يكي از اين مشخصات عكس شخص است كه با
AsyncFileUpload
استفاده كردم كه براي نمايش عكس از جاوااسكريپ استفاده كردم
تا اينجا درست يعني كاربر اطلاعات مي زنه و ذخيره مي كنه وبا كليك بر روي ركورد اطلاعات هم نمايش داده مي شود در ضمن من آدرس عكس شامل كد ملي هست .
مشكل زماني كه كاربر بخواد اطلاعات اصلاح كند و عكس عوض نماييد كه عكس در محل ذخيره عوض مي شود ولي عكس نمايش داده نمي شود
كه
من
کد HTML:
      <cc1:AsyncFileUpload ID="AsyncFileUpload2" runat="server" 
                                        OnClientUploadComplete="uploadComplete" OnClientUploadStarted="uploadComplete" 
                                         CompleteBackColor="White" FailedValidation="False" 
                                         OnUploadedComplete="FileUploadComplete" ThrobberID="Image1" 
                                         UploadingBackColor="#CCFFFF" Width="85px"   AllowedFileTypes="jpg,jpeg"
    MaximumNumberOfFiles=10 PersistFile="True" 
                                            />
  
                                    
                           

  <asp:Image ID="Image1" runat="server" style="width: 100px; height: 100px;" ImageUrl="~/anonymous.gif" />
اين كد ابزار كه



<script type="text/javascript">
// $("[id$='Txtbirthdate']").datepicker({
// minDate: '91-03-18',
// maxDate: '91-12-12',
// changeMonth: true,
// changeYear: true,
// regional: 'fa',
// showOn: 'both',
// dateFormat: 'yy-mm-dd',
// constrainInput: true,
// onSelect: function () { }
// });

function uploadStarted() {

$("[id$='Image1']").attr("src", "anonymous.gif");
}
function uploadComplete(sender, args) {
var imgDisplay = $get("Image1");

// imgDisplay.src = "anonymous.gif";
// imgDisplay.style.display = "none";
var img = new Image();
img.onload = function () {
// imgDisplay.style.cssText = "height:100px;width:100px";
$("[id$='Image1']").attr("src", img.src);

};

// img.src = "Uploads/" + args.get_fileName();

$("[id$='Image1']").attr("src", "Uploads/" + args.get_fileName());

// var fileInputElement = sender.get_inputFile();
// fileInputElement.value = "";
}
</script>


نمايش عكس هست



if (File.Exists(Server.MapPath("uploads/" + ds1.Tables[0].Rows[0].ItemArray[9].ToString() + ".jpg")))
{


// Page.Response.Redirect(Page.Request.Url.ToString() , true);
string p ="~/uploads/" + ds1.Tables[0].Rows[0].ItemArray[9].ToString() + ".jpg";
Page.Response.AddFileDependency(p);
Image1.Visible = true;
Image1.Width = 100;
Image1.Height = 100;

ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "TestAlert", "window.parent.document.getElementById('" + Image1.ClientID + "').src='" + p + "';", true);
Image1.ImageUrl = p;

اين كد انتخاب ركورد كه بخش مال عكس

if (AsyncFileUpload2.FileName != "")
{
string fn = AsyncFileUpload2.FileName;
int l = 0;
l = fn.Length - fn.LastIndexOf(".");
string newfilename = "" + Txtssn.Text + GetFileExtension(AsyncFileUpload2.FileName);
filePath = "uploads/" + newfilename;

//if (!string.IsNullOrEmpty(filedir + newfilename))
//{
// string oldphotopath = Path.Combine(filedir, filedir + newfilename);
if (File.Exists(Server.MapPath(filePath)))
{
File.Delete(filePath);
}

//AsyncFileUpload1.SaveAs(Server.MapPath(this.Upload FolderPath) + newfilename);
//UploadPhoto0.File.MoveTo(Path.Combine(filedir, newfilename));
filePath = "uploads/" + AsyncFileUpload2.FileName;
File.Delete(Server.MapPath(filePath));
filePath = "uploads/" + newfilename;
AsyncFileUpload2.SaveAs(Server.MapPath(filePath));
AsyncFileUpload2.ClearAllFilesFromPersistedStore() ;

اين هم ذخيره عكس

مشكل كجاست كه عكس در پوشه عوض مي شه ولي درست نمايش داده نمي شود در ضمن آدرس چك كردم درست روي عكس راست كليك مي كنم و open new windosدرست بشرطي من يكبار صفحه page load كنم

بنظر تون چه كنم تا درست بشه