• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 502
  • Last Modified:

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
0
psmithphil
Asked:
psmithphil
  • 5
  • 5
1 Solution
 
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
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
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

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 5
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now