In Asp.net, we often perform an image upload operation. If we want the image to be displayed before clicking the submit button, we need to do some JS processing.Onpropertychange = "document. All. imgid. src = file: // + this. Value"This is to display the image browsed in the input fileImgidTo display the image before uploading.
|
|
Code
< Tr Bgcolor = "# F5f5f5" >
< TD Height = "30" Align = "Center" Valign = "Middle" > Image Link </ TD >
< TD Height = "35" Align = "Center" Valign = "Middle" > < Input Type = "File" Name = "Uploadfile1" Runat = "Server" ID = "Uploadfile1" Onpropertychange = "Document. All. imgid. src = file: // + this. Value" > & Nbsp;
</ TD >
</ Tr >
< Tr Bgcolor = "# F5f5f5" >
< TD Height = "70" Align = "Center" Valign = "Middle" > Thumbnail </ TD >
< TD Height = "70" Align = "Center" Valign = "Middle" > < IMG ID = "Imgid" Width = "82" Height = "65" Border = "0" > & Nbsp;
</ TD >
</ Tr >