Hello All,
Am using a Fileupload control and a button. While Clicking on the button Filename in the Fileupload controls disappears!!?
I want to save the file while i click the upload button my code is as follows,
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="BulkInsert.aspx.cs" Inherits="BulkInsert" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<asp:FileUpload id="FileUpload1" runat="server" Text="Upload" Width="225px" />
<asp:Button ID="Button1" runat="server" Text="Export" OnClick="btnUpload_Click" CausesValidation="false" />
</form>
</body>
</html>
if (!FileUpload1.HasFile)
{
string path = string.Concat(Server.MapPath("~/CSV/" + FileUpload1.FileName));
FileUpload1.SaveAs(path);
}