View Single Post
  #3 (permalink)  
Old October 18th, 2008, 03:13 AM
bobwith5 bobwith5 is offline
Registered User
Join Date: Apr 2007
Location: , , .
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts

Thanks for your reply.

This is on my html side

    <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server" />
            <asp:UpdatePanel ID="UpdatePanel1" runat="server">
          <ContentTemplate >
           <asp:FileUpload ID="FileUpload1" runat="server" />
              <asp:Button ID="Button1" runat="server" Text="Upload"
            OnClick="Button1_Click" />


On coding side I write just one line

 Protected Sub Btnupload_Click(ByVal sender As Object, ByVal e As System.EventArgs)

        FileUpload1.PostedFile.SaveAs(Server.MapPath("./") & "uploadimg.jpg")

    End Sub

Error is :-
Object Reference Not Set to an instance of object.

I know this is very small error .We can over come this error by creating Instance to that object By using 'New' keyword.
At this time i'm feeling difficulty.

Help me.