Hi,
For some reason, I'm unable to upload a file with the <asp:FileUpload />
control. I know it's not just something completely pooched, because I created a new project with this code in it and that uploaded the file.
My code looks like this (some bits removed...):
<form id="querydata" runat="server" enctype="multipart/form-data">
<div class="container" runat="server">
<asp:ScriptManager ID="queryscriptmanager" runat="server" />
<asp:UpdatePanel runat="server" ID="querypanel" UpdateMode="Conditional">
<ContentTemplate>
<div runat="server" class="opaque" id="opq">
<div runat="server" class="entry">
<asp:FileUpload runat="server" ID="Directory" Width="194" />
</div>
<asp:Button runat="server" ID="Submit" Text="Update Database" onclick="checkForm" />
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</form>
If I go select a file, then click the submit button, once the execution makes it to checkForm, Directory.FileName is ""
and Directory.HasFile is False
Any clue why it won't send my file?
SOLVED:
All I had to do (per the blog post in the accepted answer) was add three lines:
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="Submit" />
</Triggers>
</asp:UpdatePanel>