简体   繁体   English

Ajaxified容器中的ASP.NET FileUpload控件

[英]ASP.NET FileUpload control in Ajaxified container

I have a FileUpload control in a Wizard control. 我在向导控件中有一个FileUpload控件。 When I click the finish button, I set a breakpoint and I can see the filepath selected in the FileUpload control as expected. 单击finish按钮时,我设置了一个断点,并且可以看到在FileUpload控件中按预期方式选择的文件路径。

However, when I Ajaxify this same Wizard, the value in the FileUpload control is always null at this breakpoint, as if a file hasn't been selected. 但是,当我对同一向导进行Ajaxify时, FileUpload控件中的值在此断点处始终为null,就好像没有选择文件一样。

I know there's a limit where a FileUpload control can't keep its value after postback, but I have the breakpoint selected on the postback and would still expect to see the value. 我知道有一个限制,即FileUpload控件在回发后无法保留其值,但是我在回发中选择了断点,并且仍然希望看到该值。

You need a full postback to use the FileUpload control, try adding the FileUpload control to the PostBackTrigger section in the UpdatePanel . 您需要完整的回发才能使用FileUpload控件,请尝试将FileUpload控件添加到UpdatePanelPostBackTrigger部分。

See: Problem using the ASP.NET FileUpload control in an UpdatePanel? 请参阅: 在UpdatePanel中使用ASP.NET FileUpload控件时遇到问题?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM