Ajax.NET Professional Demonstation Site
I'm working on a first demonstration site for Ajax.NET Professional. Maybe you can help me to decide which examples you want to see: AutoComplete, Banners, HtmlUpdater, FormUpdater, ...
Ajax.NET Professional will allow you to use your objects as return values and as arguments without the need to write a IAjaxObjectConverter:
public interface IPerson
{
string FirstName{get;set;}
}
public
class Person : IPerson{
private string firstName;
public string FamilyName;
public int Age = 0;
public double Depot = 0.0;
public Person()
{
// must have this constructor !!
}
public Person(string firstName, string familyName)
{
this.firstName = firstName;
this.FamilyName = familyName;
}
#region
IPerson Members public string FirstName
{
get
{
return this.firstName;
}
set
{
this.firstName = value;
}
}
#endregion
}
public class Boss : Person
{
public string CompanyName;
public Boss() : base()
{
// must have this constructor !!
}
public Boss(string firstName, string familyName, string companyName) : base(firstName, familyName)
{
this.CompanyName = companyName;
}
}
Now, we want to have a look at the Ajax.NET Professional method. The first method will return a IPerson object from a database. The second on will get this IPerson object from the client-side JavaScript to check if it is a Boss object.
[Ajax.AjaxMethod]
public IPerson GetPersonFromID(int id)
{
if(id == 1)
{
Person p = new Person();
p.FirstName = "Michael";
p.FamilyName = "Schwarz";
return p;
}
else
{
Boss b = new Boss();
b.FirstName = "Hans";
b.FamilyName = "Mustermann";
b.CompanyName = "Your Company";
return b;
}
}
[Ajax.AjaxMethod]
public bool IsBoss(IPerson p)
{
return p is Boss;
}
[Ajax.AjaxMethod]
public IPerson RefreshPersonObject(IPerson p)
{
p.FirstName = "Refreshed FirstName...";
return p;
}
8 Comments
Comments have been disabled for this content.
anonymous said
AutoComplete would be nice...
Wallym said
I'm thinking AutoComplete.
FcoGuerrero said
but..... when o where is Ajax.NET Professional??...
Very good !!
Michael Schwarz said
@FcoGuerrero: I hope that I can put a first beta version online tomorrow or the day after! Please check my blog for latest news.
CIAO
Michael
Olli said
Michael, YOU ARE GREAT!!!! YOU ARE THE BEST AND FASTEST DEVELOPER FOR AJAX ON .NET PLATFORM!!!!!!!!! Thanks!
FcoGuerrero said
Thanks Michael... is very very good product and in my big ERP Proyect in Spain is a essencial key in.
Tamer Fathy said
I suggest it will be better to demonstrate
by Biding DataGrid with View Details (Master Detail)will be better and bind the datagrid with collection of Person class (for example)
Thanks,
Tamer Fathy
Thomas Møller said
Can you somehow get the file size of a file through a ASP.net site using ajax.net