Пример #1
0
        protected void Button2_Click1(object sender, EventArgs e)
        {
            BaseData.CheckClassID();

            if (FileUpload2.HasFile == false || FileUpload2.PostedFile.ContentLength == 0)
                return;
            string fname = SaveFileToTemp(FileUpload2,"classes.xls");
            BaseData b=new BaseData();
            if (b.InsertClasssByExcleFile(fname) == false)
                Response.Write("导入失败,请确认格式正确,可参考页面右边样本文件");
            else this.ClientScript.RegisterStartupScript(this.GetType(), "Hint", "<script>alert('成功导入数据')</script>");

        }