<input type="file" runat ="server" class="_5f0v" title="Choose a file to upload" accept="image/*" name="file" id="File1" onchange="UploadFileNow()" clientidmode="Static" /> And UploadFileNow() javascript method is like below, function UploadFileNow() { var value = $("#File1").val(); if (value != '') { document.forms[0].submit(); } }; Now, After Uploading the file to the server side, im using registerCLient script Like below, ScriptManager.RegisterClientScriptBlock(Me, Me.GetType(), "Script", "clearFile();", True) And, Here is clearFile() Function, function clearFile() { var control = $("#File1"); control.replaceWith(control = control.clone(true)); }
<pre lang="c#"> var control = $("#File1");
var control=document.getElementById("<%=File1.ClientID%>");
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)