Friday 15 March 2013

javascript - FileUpload show waiting message while PostBack is excecuting -


For this scenario:

I have an ASP.NET file upload control and a button Postback for uploading selected file.

I would like to know what I can do with javascript:

  1. Start showing an image (image loading) when someone clicks on that button
  2. When the file upload is complete, stop showing the image

Ban: I can not use AJAX in this case.

You can do something like that.

  & lt; Asp: FileUpload id = "FileUpload" runat = "server" /> & Lt; ASP: Button ID = "BTN Upload" Runat = "Server" Text = "Upload" OnClientClick = "DisplayWaiting ()" /> & Lt; ASP: Image ID = "Image 1" runat = "server" image URL = "~ / images / wait. Jpg" style = "display: none;" / & Gt; & Lt; Script language = "javascript" & gt; Function display () {var img = document.getElementById ("Image1"); Img.style.display = 'block'; } & Lt; / Script & gt;  

Any default display attribute of the image tag is not set when the upload button is clicked when the DisplayWaiting () function to block the display attribute It is said, after showing the picture, after the page post, 'the image tag is set around any of its display attributes, hiding the image.


No comments:

Post a Comment