1

我得到了这个模态弹出扩展器,但我无法获取 FileUpload 控件上的文件。这是我的代码:

<asp:Button ID="targC" runat="server" Style="display: none;" Text="here" />
    <ajax:ModalPopupExtender ID="myExtender" runat="server" BackgroundCssClass="myModalPopupbackGrnd"
        TargetControlID="targC" PopupControlID="pnlUserRegNoti" OkControlID="btnDone">
    </ajax:ModalPopupExtender>
    <asp:Panel ID="pnlUserRegNoti" Width="70%" Style="display: none;" CssClass="myModalPopupload"
        runat="server">
<center>
            <br />
            <br />
            <table width="80%">
                <tr>
                    <td>
                        <center>
                            <h3><b>Requirements of New Application</b></h3>
                            <asp:HiddenField ID="validateUploads" runat="server" />
                            <table>
                                <tr>
                                    <td>DTI Application Form</td>
                                    <td><asp:FileUpload ID="dtiFileUpload" runat="server" onchange = "return CheckForTestFileDTI();" />
                                    <asp:CustomValidator ID="CustomValidator1" ControlToValidate="dtiFileUpload" runat="server" OnServerValidate="CustomValidator1_ServerValidate" Text="File is too large. Max size is 20MB."></asp:CustomValidator>
                                    </td>
                                    </tr>
<tr>
                    <td>
                        <center>
                            <asp:Button ID="btnDone" runat="server" CssClass="button" Text="Done" OnClick="btnDone_Click" />
                        </center>
                    </td>
                </tr>
            </table>
        </center>
    </asp:Panel>

我将使用 FileUpload 控件上的文件上传到 WindowsAzure。如何在 modalpopupextender 中获取文件上传的值?

4

1 回答 1

0

您将需要从面板中检索该 FileUpload 以在您的代码中与它进行交互:

FileUpload dtiFileUpload = (FileUpload)pnlUserRegNoti.FindControl("dtiFileUpload");
于 2013-09-16T13:58:55.567 回答