I have a modal popup and in the modal-body I have two asp.net controls FileUpload
control and LinkButton
and the markup is
<div class="modal-body">
<asp:FileUpload runat="server" ID="optinFileUpload"></asp:FileUpload>
<asp:LinkButton ID="btnImport" runat="server" class="btn btn-primary btn-block" OnClick="btnImport_Click" Text="Import"></asp:LinkButton>
</div>
Then I'm uploading the button and click the Import button and code behind is
protected void btnImport_Click(object sender, EventArgs e)
{
bool val = optinFileUpload.HasFile;
}
And the val is always showing false
even if it contains the file.
Can one tell me why it is always showing false