The class must be a page. Or if it doesn't have to, you must at least
register it with Ajax.
public [partial] class DefaultPage: System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Utility.RegisterTypeForAjax(typeof(DefaultPage), this);
{...}
}
[AjaxPro.AjaxMethod()]
private DataTable GetData()
{...}
Also, I think you might fail because your properties use a private member
instead of Session values and you might lose their value during postback.
____________
Costin Manda
ECRM Europe
----- Original Message -----
From: "pigs" <[EMAIL PROTECTED]>
To: "Ajax.NET Professional" <[email protected]>
Sent: Tuesday, September 19, 2006 5:22 AM
Subject: [ajaxpro] problem on server-side class
>
> hi
> I am trying to do like this:
>
> %sever-side:
> public class GetSelectOptions
> {
> public GetSelectOptions()
> {...}
>
> private string m_Sql = "";
>
> public string Sql
> {
> get { return m_Sql; }
> set { m_Sql = value; }
> }
>
> [AjaxPro.AjaxMethod()]
> private DataTable GetData()
> {...}
> }
>
> %client-side:
> alert(GetSelectOptions.Sql);
>
> but I failed!
> I want to know can I do like that?
> if possible,how?
> if imp, is there some other way to actualize that kind of instance?
> thx.
>
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
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/
Don't forget to read my blog at http://weblogs.asp.net/mschwarz/
-~----------~----~----~----~------~----~------~--~---