Welcome Guest! You need to login or register to make posts.

Notification

Icon
Error

Options
Go to last post Go to first unread
Maxx  
#1 Posted : Monday, June 19, 2006 7:33:16 PM(UTC)
Maxx

Rank: Member

Groups: Member
Joined: 6/19/2006(UTC)
Posts: 3

Environment: asp.net C#

I have tried to write Response.Write("Error"); in the server side program (.cs) and catch the result by client side javascript (.aspx) as below.

Code:
if (Status=="COMPLETE"){
        if(StatusText == "Error"){
            alert("Error occurs");
        }
}


But it can't work, anybody help? The StatusText seems not equal to "Error".

Edited by user Monday, February 18, 2008 4:28:13 PM(UTC)  | Reason: Not specified

Fedor  
#2 Posted : Monday, June 19, 2006 8:34:25 PM(UTC)
Fedor

Rank: Advanced Member

Groups: Member, Administration, Moderator
Joined: 7/28/2003(UTC)
Posts: 1,537

Thanks: 4 times
Was thanked: 56 time(s) in 55 post(s)
JavaScript string equality operator (==) is case-sensitive. So you should use "ERROR" string of "Error" one.

This code (syntax with iuembed.js) works for me:

Code:
iu.addEventListener("Progress", "ImageUploader_Progress");
function ImageUploader_Progress(Status, Progress, ValueMax, Value, StatusText){
	if (Status=="ERROR"){
		alert(StatusText);
	}
}


For testing I used following server-side code:

Code:
Response.Write ("Hello")
Response.StatusCode = 500


P.S. It seems [code] forum tag is broken and admin should fix it. :(

Edited by user Monday, February 18, 2008 4:28:42 PM(UTC)  | Reason: Not specified

Best regards,
Fedor Skvortsov
Maxx  
#3 Posted : Tuesday, June 20, 2006 11:37:21 AM(UTC)
Maxx

Rank: Member

Groups: Member
Joined: 6/19/2006(UTC)
Posts: 3

Thank you for your reply.

But still can't work for the following code on the client side:

Code:
if (Status == "ERROR"){
  alert(StatusText);
}


The StatusText displays a lot of the codes and seems can't terminate on the screen.

Do I need to clear something first for the response action?

Edited by user Monday, February 18, 2008 4:28:57 PM(UTC)  | Reason: Not specified

uhleeka  
#4 Posted : Wednesday, June 21, 2006 6:12:29 AM(UTC)
uhleeka

Rank: Member

Groups: Member
Joined: 6/21/2006(UTC)
Posts: 1

I'm not sure if I understand completely, but if you are trying to generate only the string "Error" as the response, maybe the following will help:

Code:
Response.Clear();
Response.Write("Error");
Response.End();

Edited by user Monday, February 18, 2008 4:29:15 PM(UTC)  | Reason: Not specified

UKPaul  
#5 Posted : Tuesday, March 31, 2009 6:36:00 AM(UTC)
UKPaul

Rank: Newbie

Groups: Member
Joined: 3/31/2009(UTC)
Posts: 1

Hi

I am experiencing the same issue where by if the response from my processing page completes successfully then the Event Listener fires fine (i.e. "COMPLETE") but if the process page generates a 500 error it doesn't, (i.e. "ERROR")

Code:

function ImageUploader_Progress(Status, Progress, ValueMax, Value, StatusText)
{
	if (Status=="COMPLETE"){
      alert(StatusText);
	}
	if (Status=="ERROR"){
      alert(StatusText);
	}	     		
}
var iu = new ImageUploaderWriter("ImageUploader", 800, 600);
iu.addParam("Action", "PROCESS PAGE");
iu.addEventListener("AfterUpload", "ImageUploader_Progress");



Is this a known issue and is there any other way of checking whether the PROCESS PAGE has errored in any other way?

Any help would be great

Ta
MyHuntSite  
#6 Posted : Tuesday, March 31, 2009 2:23:30 PM(UTC)
MyHuntSite

Rank: Newbie

Groups: Member
Joined: 3/18/2009(UTC)
Posts: 4

I ran into this over a year ago. So I created my own and its worked flawlessly.


Sever-Side on uploading images:

Create a try catch block and use

string _errorScript = null;
_errorScript = "<script type='text/javascript'>YOURJAVASCRIPTFUNCTION();</script> ";
ClientScript.RegisterStartupScript(this.GetType(), "closeWin", _errorScript);








Edited by user Tuesday, March 31, 2009 2:24:38 PM(UTC)  | Reason: Not specified

Tamila  
#7 Posted : Monday, April 06, 2009 3:12:05 AM(UTC)
Tamila

Rank: Advanced Member

Groups:
Joined: 3/9/2008(UTC)
Posts: 554

Was thanked: 1 time(s) in 1 post(s)
Hello,

I just tried to generate "500" server error using the following code:
Code:
Response.StatusCode = 500;

On client side I used your code sample:
Code:
function ImageUploader_Progress(Status, Progress, ValueMax, Value, StatusText)
{
    if (Status=="COMPLETE"){
		alert(Status);
		alert(StatusText);
    }
    if (Status=="ERROR"){
		alert(Status);
		alert(StatusText);
    }                 
}

In this case Image Uploader gets Status = "ERROR".
I have reproduced this situation with Image Uploader 5.7.24. Try to use this version.
Aurigma Support Team

UserPostedImage Follow Aurigma on Twitter!
Users browsing this topic
Similar Topics
Server response code 201 showing error message in uploader (Discussions – ActiveX/Java Uploader)
by ndonnan 6/19/2009 2:01:10 AM(UTC)
Server Response window.. (Discussions – ActiveX/Java Uploader)
by ravikiran 9/13/2006 6:47:14 AM(UTC)
server response and http response code (Discussions – ActiveX/Java Uploader)
by andyr 6/16/2005 5:49:00 AM(UTC)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.