Introduction:
Description:
In
previous article I explained validate file extension before file upload in JavaScript, validate file upload extension in jQuery, jQuery fixed header notification bar
example
and many articles relating to jQuery,
JavaScript.
Now I will explain how to clear file
upload control
in asp.net using JavaScript.
To
Clear file upload control in JavaScript we need to write the following code
your page
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1">
<title>validate fileupload control using jquery</title>
<script language="javascript" type="text/javascript">
function ClearFileUploadControl() {
var uplctrl = document.getElementById("fileupload1");
uplctrl.select();
clrctrl = uplctrl.createTextRange();
clrctrl.execCommand('delete');
uplctrl.focus();
}
</script>
</head>
<body>
<form id="form1"
runat="server">
<div>
<table><tr>
<td><b>Upload Images:</b></td>
<td><asp:FileUpload ID="fileupload1"
runat="server"
/></td>
</tr>
<tr><td></td><td><asp:Button ID="btnSubmit"
Text="Submit"
runat="server"
OnClientClick="ClearFileUploadControl()"
/></td></tr>
</table>
</div>
</form>
</body>
</html>
|
If you enjoyed this post, please support the blog below. It's FREE! Get the latest Asp.net, C#.net, VB.NET, jQuery, Plugins & Code Snippets for FREE by subscribing to our Facebook, Twitter, RSS feed, or by email. |
|||
|
|||
3 comments :
Where is output ?
sssssssssssssss
jhnjjjjjj
Note: Only a member of this blog may post a comment.