Bug in MS AJAX UpdateProgress component

I'm using asp.net & vb.net in Visual Studio 2005 & IE6.  I have a web application that uses the FileUpload component to choose a file on the hard disk, process the file, and then return a message in the Label to indicate that the process is done.  When I made it an AJAX project, this working program failed with the error message "Object reference not set to an instance of an object" (only the label is in the UpdatePanel).  I have attached a Word document, which I think should outline the problem, but please let me know if there is more I need to provide.  

Thank you for your help.
Experts-Exchange-Bug-in-MS-AJAX-.doc
psmithphilAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Bob LearnedCommented:
Do you have the complete stack trace for that exception, and not just the error message?  Do you know what line it happens on?

Bob
0
psmithphilAuthor Commented:
Thank you for helping, Bob!  Did you notice I included a Word document that explains the problem and has pictures?  I was hoping it would outline the process better than I could explain it with just words.

The error occurs on the first line in the btnProcess Sub:
strDownloadDumpFile = FileUpload1.PostedFile.FileName   'Full file and path.

The StackTrace doesn't supply much:
System.NullReferenceException: Object reference not set to an instance of an object.
   at Main.btnProcess_Click(Object sender, EventArgs e) in C:\MyDocuments\Visual Studio 2005\WaterMarkDocs\Main.aspx.vb:line 60"
?ex.StackTrace
0
Bob LearnedCommented:
1) I looked at the document

2) All it showed was a simple message, and not a stack trace.

3) FileUpload1.PostedFile can be nothing if the page posts back, since it doesn't have a ViewState, and you can't programmatically set the file name.

4) ASP.NET button controls do a post-back by default, so there will be a problem.

Bob
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

psmithphilAuthor Commented:
Yes, the document doesn't have the StackTrace.  The StackTrace is:
System.NullReferenceException: Object reference not set to an instance of an object.
   at Main.btnProcess_Click(Object sender, EventArgs e) in C:\MyDocuments\Visual Studio 2005\WaterMarkDocs\Main.aspx.vb:line 60"
?ex.StackTrace

So with a FileUpload control, I can't do what I want?  
0
Bob LearnedCommented:
Nope, Monday blues!!  The FileUpload should work, it is being messed up by the UpdatePanel.

Bob
0
Bob LearnedCommented:
The problem is that the FileUpload control needs a full post-back in order to work properly.  

Try setting the ScriptManager like this (turning off partial rendering):
        <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="false" />

Bob
0
psmithphilAuthor Commented:
Using "EnablePartialRendering" gets rid of the error message, but it works like it does if I use "PostBackTrigger" instead of "AsyncPostBackTrigger".  It processes the file, but the AJAX animation doesn't work.

If I'm seeing this correctly, there is no way to do what I want.  I thought AJAX would be cool, but I guess some of it doesn't work in the real world. It would seem it would be easy to allow a user to get a dialog box to pick a file, then my program could process the file as necessary.  Along with it would be an animation indicating the processing is happening.  But I guess it can't be done with AJAX.

It seems like you've answered my question, that it can't be done, so I will award you the points.  I very much appreciate your help!

Would it do me any good to ask a new question to see if there is another control that will present the user with a dialog box to choose the file, and have the AJAX animation work while the file processes?
0
Bob LearnedCommented:
Have you heard of Telerik R.A.D. controls?

http://www.telerik.com/products/aspnet/overview.aspx

They have some really cool controls, which use AJAX internally, and also work with other versions of AJAX.  There is a pretty extensive list of controls, including the RadUpload control.

Bob
0
psmithphilAuthor Commented:
Thank you for the tips on telerik, Bob.  I'll see if they'll help.  But it sure seems like this is a simple thing I want to do, and that Microsoft's stuff should handle it.
0
psmithphilAuthor Commented:
Well, Bob, the answer is that what I want to do can't be done with AJAX.   Major bummer.   I appreciate your help very much!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.