aspx:
<asp:UpdatePanel ID="updtEmpMaster" runat="server">
<ContentTemplate>
<asp:FileUpload ID="tPhoto" Height="23px" runat="server" />
<asp:Button ID="Button1" CssClass="btnImage" runat="server" Text="OK"
onclick="Button1_Click" />
</ContentTemplate>
</asp:UpdatePanel>
aspx.cs:
protected void Button1_Click(object sender, EventArgs e)
{
if (tPhoto.HasFile)
{
…………………..;
}
else
{
…………………..;
}
}
Here if condition is failing even after an image file is uploaded. No problem when using without UpdatePanel. UpdatePanel is also needed in current scenario. Any way I can have solution with UpdatePanel.
As per link http://forums.asp.net/p/1105208/1689084.aspx
This problem is somewhat well documented, the update panel is listed as not working with certain controls.
File upload, and tree view being 2 of the biggies.
IN any case, one solution is available on code project:
http://www.codeproject.com/useritems/simpleajaxupload.asp
if you look around the forums and google, you can read more about the problem if your interested, but the code project solution should get you started.