文件上传的更新面板

<asp:FileUpload runat="server" ID="uploadCertification" />
<asp:Button runat="server" ID="btntext" OnClick="btntext_Click" />

Code

uploadCertification.PostedFile.SaveAs(serverPathImage + "\\CertificationCompany\\as.td");

this code work fine but when

 <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
      <asp:UpdatePanel ID="UpdatePanel3" runat="server"><ContentTemplate>
     <asp:FileUpload runat="server" ID="uploadCertification" />
      <asp:Button runat="server" ID="btntext" OnClick="btntext_Click" />
</ContentTemplate></asp:UpdatePanel>

Code

 uploadCertification.PostedFile.SaveAs(serverPathImage + "\\CertificationCompany\\as.td");

this line say error: Object reference not set to an instance of an object.

Unfortunatly the UpdatePanel does not work with some controls, notably the FileUpload control. I believe there is a problem with uploading files using javascript. Have a look here http://msdn.microsoft.com/en-us/library/bb386454.aspx for a better explaination.

I have got around this problem in the past using an Iframe on a seperate page that does the upload. http://www.codeproject.com/KB/aspnet/FileUploadingWithLoading.aspx

Take a look at using a PostBackTrigger within your UpdatePanel:

PostBackTrigger

The above MSDN article contains a code listing for using a PostBackTrigger with a FileUpload control.

Other approaches available to you are to use the iframe approach (mentioned in one of the other answers) or to use one of the many third party components out there which make use of javascript and flash to upload files (Find links to a couple of the more popular ones below)

Uploadify

SWFUpload