protected void btnUpload_Click(object sender, EventArgs e)
{
if (FileUpload1.HasFile == true)
{
filePath = Server.MapPath("~/FileUpload/" + FileUpload1.FileName);
string strExension = Path.GetExtension(filePath);
if (strExension == ".xls")
{
FileUpload1.SaveAs(filePath);
readExcel(filePath, "Source Data");
}
else
{
lblError.ForeColor = System.Drawing.Color.Red;
lblError.Text = "Please select a file with .XLS file extension (Excel File).";
}
No comments:
Post a Comment