大家好,我是个新手,才接触.NET3个月,请大家多指教
我的问题是提示错误:上下文中不存在fileupload
源代码是:
public partial class _Default : System.Web.UI.Page
    {
        string strconn;
        OracleConnection cn;        protected void Page_Load(object sender, EventArgs e)
        {
            strconn = ConfigurationManager.ConnectionStrings["Connection String"].ToString();
            cn = new OracleConnection(strconn);
        }        protected void Button1_Click(object sender, EventArgs e)
        {
            string type1 = FileUpload1.[/color]PostedFile.FileName;
            string type = type1.Substring(type1.LastIndexOf(".") + 1);
            //string dbName = Path.GetFileName(FileUpload1.FileName).Replace(".xls", "");
            if (string.Equals(type, "xls"))
            {
                string strCon = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + type1 + ";Extended Properties='Excel 8.0;IMEX=1'";
                System.Data.OleDb.OleDbConnection Conn = new System.Data.OleDb.OleDbConnection(strCon);
                string strCom = "SELECT * FROM [Sheet1$]";
                DataSet ds = new DataSet();
                Conn.Open();
                System.Data.OleDb.OleDbDataAdapter myCommand = new System.Data.OleDb.OleDbDataAdapter(strCom, Conn);
                myCommand.Fill(ds, "[Sheet1$]");
                Conn.Close();
                if (ds != null)
                {
                    GridView1.DataSource = ds;
                    GridView1.DataBind();
                    Session["a"] = ds;
                    //File.Delete(newName);
                    Button2.Visible = true;
                }
            }
            else
            {
                this.Page.Response.Write("<script>alert('文件格式不正确')</script>");
            }
        }