본문으로 바로가기

ClearUpLoad asp.net

category 웹/웹.php.asp 2009. 2. 20. 18:33


The following script will help us to clear the FileUpload control in ASP.Net 2.0.

 

<script language="javascript">

    function ClearFileUpload()

    {

    var fil = document.getElementById("FileUpload1");

   fil.select();

   n=fil.createTextRange();

   n.execCommand('delete');

   fil.focus();

    }

    </script>

 

<asp:FileUpload ID="FileUpload1" runat="server" />

<asp:Button ID="Button1" runat="server" OnClientClick="ClearFileUpload()" Text="Clear" />

 

When we click the Clear button the FileUpload control will be cleared.