Solved

ASP.NET

Posted on 2011-03-09
13
554 Views
Last Modified: 2012-05-11
"Server Response Error: 'Unknown Server error'"

Get this when trying to use Ajax AsyncFileUpload.

Have adjusted the web.config, checked the control name and events.  Registered the Ajax assembly.
0
Comment
Question by:triplebd69
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 6
13 Comments
 
LVL 2

Expert Comment

by:cefranklin
ID: 35086882
Write access to the directory?
0
 

Author Comment

by:triplebd69
ID: 35086947
I am not getting past the clientsideupload.
<ajax:AsyncFileUpload ID="fuSlides" Width="400px" runat="server"
				OnClientUploadError="uploadError" 
				OnClientUploadStarted="StartUpload" 
				OnClientUploadComplete="UploadComplete" 
				CompleteBackColor="Lime"
				UploaderStyle="Modern" 
				ErrorBackColor="Red" 
				onuploadedcomplete="fuSlides_UploadedComplete" 
				UploadingBackColor="#66CCFF" />


 <script type="text/javascript" language="javascript">
	     function uploadError(sender, args) {
//	         alert("[" + lblStatus + "]"); return false;
	         document.getElementById('<%= lblStatus.ClientID %>').innerHTML = args.get_errorMessage();
	         alert(args.get_fileName() + ' could not be uploaded. ' + args.get_errorMessage());
		 }
	     function StartUpload(sender, args) {
//	         alert("[" + fuSlides + "]"); return false;
			 var filename = args.get_fileName();
			 var filext = filename.substring(filename.lastIndexOf(".") + 1);
			 if (filext == "doc" || filext == "docx" || filext == "pdf" || filext == "pages" || filext == "pptx" || filext == "ppt") {
				 return true;
			 }
			 else {
				 var err = new Error();
				 err.name = 'My API Input Error';
				 err.message = 'Only .ppt, .pptx, .doc, .docx, or .pdf  files';
				 throw (err);

				 return false;
			 }
		 }
	    function UploadComplete(sender, args) {
			var filename = args.get_fileName();
			var contentType = args.get_contentType();
			var text = "Size of " + filename + " is " + args.get_length() + " bytes";
			if (contentType.length > 0) {
			    text += " and content type is '" + contentType + "'.";
			    __doPostBack('UploadPostback', '');
			}
		}

Open in new window

0
 
LVL 2

Expert Comment

by:cefranklin
ID: 35087025
I haven't messed around with that control much but, still, make sure the IWAM and IUSR have write access to the folder, also check this out:
http://blog.mrt-web.com/2010/12/ajax-control-toolkit-asyncfileupload.html

If you're sure about those two steps and still you get the same error, the simple workaround is to change the value of "ClientIDMode" to "AutoID".
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:triplebd69
ID: 35087245
I have tried to insert ClientIDMode="AutoID" nut i get this error

'ClientIDMode' is not a member of 'AjaxControlToolkit.AsyncFileUpload'.
0
 
LVL 2

Expert Comment

by:cefranklin
ID: 35087395
Eww, sorry about that. I am reading also that other developers are using Fiddler to see the exact error.  Maybe that can help your narrow it down.

Sorry I don't have any solutions, just trying to help you work through this :)
0
 

Accepted Solution

by:
triplebd69 earned 0 total points
ID: 35087397
Turns out that this site is running on 2.0 framework, so I don't think that I can get this control to work on it, I believe that it needs the 3.5 framework or higher.
0
 
LVL 2

Expert Comment

by:cefranklin
ID: 35087439
Check to see if 3.5 is installed in C:\Windows\Microsoft.NET\Framework.  If there is a v3.5 folder, it is installed.  If it is installed and the website is set to 2, then it is also using 3.5.
0
 
LVL 2

Expert Comment

by:cefranklin
ID: 35087447
Oh, also, if you have access to the web server itself, make sure the v2 asp.net extension is enabled.
0
 

Author Comment

by:triplebd69
ID: 35087558
Currently I am running this on my local machine.  In the C:\Windows\Microsoft.NET\Framework folder I have v2, v3.0, v3.5, v4.0
0
 
LVL 2

Expert Comment

by:cefranklin
ID: 35087593
Yeah, so asp.net 3.5 should be good to go, you could run C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis.exe -r to reinstall and will set all websites to use that version.

I think after that if it still doesn't work your best bet would be to get fiddler.  FireFox also has Firebug so you can see the XHR requests.
0
 
LVL 2

Expert Comment

by:cefranklin
ID: 35095916
What framework did you need? 4?
0
 

Author Comment

by:triplebd69
ID: 35096361
2.0
0
 

Author Closing Comment

by:triplebd69
ID: 35135812
Using wrong framework
0

Featured Post

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction A frequently asked question goes something like this:  "I am running a long process in the background and I want to alert my client when the process finishes.  How can I send a message to the browser?"  Unfortunately, the short answer…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question