Hi AbdulHaque,
Refer the below example. FileUpload control requires a full postback in order to get the HasFile property. So use PostBackTrigger.
HTML
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:FileUpload ID="FileUpload1" runat="server" />
<asp:Button ID="btnUpload" runat="server" Text="Upload" OnClick="Upload_File" />
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="btnUpload" />
</Triggers>
</asp:UpdatePanel>
C#
protected void Upload_File(object sender, EventArgs e)
{
bool hasFile = FileUpload1.HasFile;
}
It will return true.