Hello,
I want to upload the file in my application. when I write the code without using ajax update panel, then it is uploading the file.
but when i use update panel, then file is not uploading file, it showing there is no any file in the upload control.
my code is as follows
HTML view
<form id="form1" runat="server"><asp:ScriptManager ID="ScriptManager1" runat="server" />
<asp:UpdatePanel ID="update" runat="server"><ContentTemplate>
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" />
<asp:FileUpload ID="FileUpload1" runat="server" /></ContentTemplate>
</asp:UpdatePanel>
</form>
and i just written in code behind
protected void Button1_Click(object sender, EventArgs e)
{
if (FileUpload1.HasFile)
{
Response.Write(FileUpload1.FileName.ToString());
}
}
but it giving the exception.
please help me..