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

Notification

Icon
Error

Options
Go to last post Go to first unread
rdeigsler  
#1 Posted : Saturday, September 03, 2005 5:13:19 AM(UTC)
rdeigsler

Rank: Member

Groups: Member
Joined: 8/20/2005(UTC)
Posts: 8

When I try to execute a remote script passing a string array, it fails. No error message, it just does not execute. The same script works if I use int, bool, or float data types but not with strings. Below is an example of the javascript that calls the server code and the server method also. I realize in the following example that a string is not the correct data type for the Blur method, but it is just an example. I get the same problem with any method trying to accept a string.

Code:
<script>
function blurImage()
{
	if (!bmv.invokeRemoteMethod("BlurImage",new Array("10","1")))
	{
		alert("Please wait until previous operation is completed.");
	}	
	checkExceptions();
}
</script>
 
[RemoteScriptingMethod]
public void BlurImage(string radius, string pos)
{
  bmvEditor.Bitmap.UndoRedoEnabled = true;
  bmvEditor.Bitmap.Transforms.Blur((float)Convert.ToInt32(radius), Transforms.BlurType.Gaussian);
}


Also, when I change the code to pass just one argument, it fails no matter what data type. Hence, the extra argument in the preceding example.

Thank you for your help,
Rick Deigsler

Edited by user Sunday, December 23, 2007 5:43:41 PM(UTC)  | Reason: Not specified

rdeigsler  
#2 Posted : Saturday, September 03, 2005 9:02:40 PM(UTC)
rdeigsler

Rank: Member

Groups: Member
Joined: 8/20/2005(UTC)
Posts: 8

A correction to the last sentence...when I pass 1 element in the second argument in the javascript the method fails. Whether it is a new array with 1 element or just passing a single value. see below

Code:
if (!bmv.invokeRemoteMethod("BlurImage",new Array("10")))

or
Code:
if (!bmv.invokeRemoteMethod("BlurImage",10))
Fedor  
#3 Posted : Monday, September 05, 2005 12:09:05 AM(UTC)
Fedor

Rank: Advanced Member

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

Thanks: 4 times
Was thanked: 53 time(s) in 52 post(s)
Hello,

Quote:
rdeigsler (9/4/2005)
A correction to the last sentence...when I pass 1 element in the second argument in the javascript the method fails. Whether it is a new array with 1 element or just passing a single value. see below

Code:
if (!bmv.invokeRemoteMethod("BlurImage",new Array("10")))

or
Code:
if (!bmv.invokeRemoteMethod("BlurImage",10))


According JavaScript documentation when we pass one parameter in Array constructor

Code:
new Array(arrayLength)


we create the array with length specified in this parameter.

So way the correct code will be:

Code:
var params=new Array();
params(0)="10"
if (!bmv.invokeRemoteMethod("BlurImage", params))
Best regards,
Fedor Skvortsov
Fedor  
#4 Posted : Monday, September 05, 2005 4:11:44 PM(UTC)
Fedor

Rank: Advanced Member

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

Thanks: 4 times
Was thanked: 53 time(s) in 52 post(s)
Quote:
rdeigsler (9/4/2005)
A correction to the last sentence...when I pass 1 element in the second argument in the javascript the method fails. Whether it is a new array with 1 element or just passing a single value. see below

Code:
if (!bmv.invokeRemoteMethod("BlurImage",new Array("10")))

or
Code:
if (!bmv.invokeRemoteMethod("BlurImage",10))


Also I recommend you to set DebugFrameVisible to true value for debug info view.

Edited by user Tuesday, January 01, 2008 5:17:30 AM(UTC)  | Reason: Not specified

Best regards,
Fedor Skvortsov
Users browsing this topic
Similar Topics
Strings not supported for remote scripting? (Discussions – Graphics Mill)
by jcavaliere 11/2/2005 3:20:32 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.