Google Groups Home
Help | Sign in
Ajaxpro custom class error
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Collapse all
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post will appear after it is approved by moderators
kyithaaung@gmail.com  
View profile
 More options Jul 18, 11:36 am
From: "kyithaa...@gmail.com" <kyithaa...@gmail.com>
Date: Fri, 18 Jul 2008 08:36:13 -0700 (PDT)
Local: Fri, Jul 18 2008 11:36 am
Subject: Ajaxpro custom class error
I can see a number of ppl had trouble with the error "Specified method
is not supported". I am also having the same trouble.. I have checked
my code and I can't find anything unusual about it. I just want to
pass an object back to the server and I am stuck with that error.

My .net class looks like this. It is a plain class with all variables
public and a public no-argument constructor. (note: ApasRegularView is
another class with similar structure).

 public class ClassFeeView
    {
        public long Id;
        public long IdPaymentAdvice;
        public ApasRegularView RegularClass;
        public int Absence;
        public int Prorate;
        public int Makeup;
        public int Forfeit;
        public int Credit;
        public int NextMonthCredit;
        public int CreditAdjustment;
        public int PayableCredit;
        public decimal PerLessonFee;
        public decimal PayableFee;
        public string PrivateRemark;
        public string PublicRemark;
        public string PaymentAdviceText;
        public int IsExcluded;
        public string ColorCode;
        public string Status;
        public ArrayList FeeDeviations;
        public string TransientStatus;

        public ClassFeeView()
        {
            FeeDeviations = new ArrayList();
            TransientStatus = "";
        }

one of my .net method returns an array of those ClassFeeView objects
and they are displayed at client browser. When the user click submit,
browser javascript will fill the object with user inputs and submit it
to my .net method below
[AjaxPro.AjaxMethod()]
public ClassFeeView  UpdateClassFee(ClassFeeView obj)
{
... code to update and return updated ClassFeeView object

}

There, i am getting "Specified method is not supported" error.

Ok. there was one hiccup. The object I am trying to submit back to the
server is not the instance that I received from the server (unlike
Michael Schwarz's class example where the object submitted back to the
server is the same instance received from the server but I really dun
think this matters anyway, am I right?  example url:
http://www.ajaxpro.info/Examples/Classes/default.aspx ) . Because the
object undergoes some changes during its stay in client browser (added
some additional properties) and I need to keep the instance unchanged,
I "clone" the object using Prototype library's Object.clone method,
strip cloned object off additional properties I added in my code (so
that the object I submit back to the server have the same properties
as it had originally), and I even set the two "dangerous" properties
null. (the ApasRegularView, and FeeDeviation ArrayList). But, the
error persists.. I have no idea what is wrong. Can anyone help me?
thanks a lot.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Murat Tufekci  
View profile
 More options Jul 22, 2:52 am
From: "Murat Tufekci" <tufe...@gmail.com>
Date: Tue, 22 Jul 2008 09:52:35 +0300
Local: Tues, Jul 22 2008 2:52 am
Subject: Re: [ajaxpro] Ajaxpro custom class error

There must be non null variable. So in constructor you have to assign
temprorary values. Int double float etc. does not matter but string variable
can be null so you should assign string.Empty in constructor. If you get an
instance and take to javascript side this null variable cause errors. So
assign string.Empty to string variables.

On Fri, Jul 18, 2008 at 6:36 PM, kyithaa...@gmail.com <kyithaa...@gmail.com>
wrote:

--
Murat Tüfekçi
MDM IT - Dim-ension Software Group
Main Developer
www.dim-ension.com

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
kyithaaung@gmail.com  
View profile
 More options Aug 15, 12:56 am
From: "kyithaa...@gmail.com" <kyithaa...@gmail.com>
Date: Thu, 14 Aug 2008 21:56:51 -0700 (PDT)
Local: Fri, Aug 15 2008 12:56 am
Subject: Re: Ajaxpro custom class error
The error I am talking about is not from server to client but from
client to server. Server to client has no problem. The problem is when
the client browser submit the object back to server, the server asp
code hit the error "Specified method
is not supported".

But, anyway, I think I've found the problem (if i am not wrong). The
problem is with Decimal and I think Michael's code (ajaxpro code) has
a slight problem with Decimal datatype. I eliminated suspicious
properties one by one and the error is no longer thrown when I removed
Decimal. When i change Decimal to Double, it works fine. So, I checked
Michael's source code. And, I found this problem.

When decimal numbers are submitted back to server, in the submitted
json string, the decimal values are quoted. When attempting to
deserialize the value, the method to deserialize it (in
DecimalConverter.cs) expects a number and it gets a string, so the
error is thrown. So, I think we need to change the client code to
submit the decimal values without quotes. I sent a message to Michael
but he has not replied yet. Anw, since I don't know how to remove
quotes, I just modified the DecimalConverter.cs to not throw the error
and it is working fine for me now.

On Jul 22, 2:52 pm, "Murat Tufekci" <tufe...@gmail.com> wrote:


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
wy6728582  
View profile
 More options Aug 27, 11:43 pm
From: wy6728582 <wy6728...@126.com>
Date: Thu, 28 Aug 2008 11:43:37 +0800 (CST)
Local: Wed, Aug 27 2008 11:43 pm
Subject: Re:[ajaxpro] Re: Ajaxpro custom class error

在2008-08-15 12:56:51,"kyithaa...@gmail.com" <kyithaa...@gmail.com> 写道:


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google