Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想在代码隐藏中访问 FileUpload 控件。这是我的代码: FileUpload file = (FileUpload)this.FindControl("FleUpload");
并且控件位于 FormView 中。但是在我运行项目后“文件”的值为空。我应该怎么做才能访问 formview 中的 FileUpload 控件?
请帮忙
我试过这段代码:
if(FormView1.CurrentMode == FormViewMode.Edit){ FileUpload f = (FileUpload) FormView1.FindControl("FleUpload"); .... then rest of code }
它奏效了。