FileUpload control working on second click but not first attempt of saving posted file?
===

[My Question][1]

I managed to answer myself, however the same set of functionality has another problem.  For some reason the first postback of the save event of the posted file hits the Ol' Object not set to an instance of an object error, but on the second attempt of uploading a file and firing my save event (converts to byte[] an stored as SQL Server BLOB) it does everything is supposed to do.

[Same problem here][2]

There is a good suggestion of using the AJAX AsyncUpload control however I am a firm believer of removing the cause and not treating the problem.  I will continue down this route to best my understanding of asp.net etc.

Would there be a wizrd amongst you that could help me identify why I get "object ref not set to inst of obj" error on first postback but on second it works fine.  Content page has a master page which wraps content page in an update panel.  Not my decision to do this.  There is also an update panel with postback triggers targeting my save event.

What are your thoughts people?


  [1]: http://stackoverflow.com/questions/11559762/fileupload-control-not-working-outside-ajax-update-panel-but-works-inside-wi/11560109#11560109
  [2]: http://stackoverflow.com/questions/8388340/fileupload-updatepanel-does-not-work-on-first-click