asp.net - updating text box after ajax file upload -


I'm more use Ajax file in your project and it is working fine, my problem is the way just how I Can I save the picture I just uploaded? Basically I manually copy a successful upload to the path for a TextBox control after calling the SaveAs method of Ajax and around the text box with an UpdatePanel and tried panel to update , But it does not seem to work.

This uploadedComplete code for the event:

  protected void AsyncFileUpload1_UploadedComplete (object sender, AjaxControlToolkit.AsyncFileUploadEventArgs e) {System.Threading.Thread.Sleep (3000); If (AsyncFileUpload1.HasFile) {var relativeFolder = DateTime.Now.Year.ToString (CultureInfo.InvariantCulture) + Path.DirectorySeparatorChar + DateTime.Now.Month + Path.DirectorySeparatorChar; Reltivefaolder = Reltivefaolderkrepls ( '\\', '/'); Var Folder = Util Relyabweboot + "Postfoto /" + Relative Folder; Var filename = path GetFileName (e.FileName); AsyncFileUpload1.SaveAs (Server.MapPath (folder + filename)); TxtPostPhoto.Text = Folder + Filename; PostImage.ImageUrl = txtPostPhoto.Text; PostPhotoUpdatePanel.Update (); }}   

txtPostPhoto is my text box.

PostImage is where I am trying to display image preview.

Is there another way of doing this?

itemprop = "text">

to save photopath in a viewstate

  Protected Zero AsyncFileUpload1_UploadedComplete Try (Object Sender, AjaxControlToolkit.AsyncFileUploadEventArgsE) {ViewState ["Path"] = "Your Path" Page Client script. Client side puts a script tag in the Registered field ("vpath", ViewState ("Path"))   

,

     

Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -