Hello,
I have a problem with AjaxPro.AjaxNoTypeUsage attribute: I have tried
to use it but I've catched this error message:

"Invalid property id"
"r.value = {,"MyString":"string","MyDateTime":new Date( ... "

The error is after the initial comma. It seems that the __type property
is omitted, but not the comma between the property and the next one (it
sounds a little strange to me, my example is a very trivial one).

Here is my C# class:
[AjaxPro.AjaxNoTypeUsage]
    public class MyClass {
        private string myString;
        private DateTime myDateTime;
        public string MyString {
            get { return myString; }
        }
        public DateTime MyDateTime {
            get { return myDateTime; }
        }
        public MyClass(string str, DateTime dt) {
            myString = str;
            myDateTime = dt;
        }
    }


Here is my page code:
public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        AjaxPro.Utility.RegisterTypeForAjax(typeof(_Default));
    }

    [AjaxPro.AjaxMethod]
    public static MyClass Test() {
        return new MyClass("string", DateTime.Today);
    }
}

And here is my page:
<%@ Page Language="C#" AutoEventWireup="true"
CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
<html xmlns="http://www.w3.org/1999/xhtml"; >
<head runat="server">
    <script type="text/javascript">
        function Test() {
            var obj = _Default.Test();
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <a href="javascript:Test()">test</a>
    </div>
    </form>
</body>
</html>


I can give you my solution, if needed. I'm using version 6.7.9.1.
Thanks a lot, bye


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Ajax.NET Professional" group.

To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]

For more options, visit this group at http://groups.google.com/group/ajaxpro

The latest downloads of Ajax.NET Professional can be found at 
http://www.ajaxpro.info
-~----------~----~----~----~------~----~------~--~---

Reply via email to