SERVER
Class Person
{
public int id;
public int SomeProp{ get{return id+1;}}
}
[WebMethod]
public Person GetPerson()
{
return new Person();
}
CLIENT
I want to use the "SomeProp" Property in the Client Side.. How could i do it?
Class Person
{
public int id;
public int SomeProp{ get{return id+1;}}
}
[WebMethod]
public Person GetPerson()
{
return new Person();
}
I want to use the "SomeProp" Property in the Client Side.. How could i do it?
If I get it right, you don't want to just transfer the object from the server to the client. You want the client to be able to execute the code of the object, defined on the server. There are many ways to do this:
You could define a new WebMethod
calculating the value of SomeProp
for the specific Person
.
.NET remoting is like Java RMI. You create a local stub object on the client side and when you call its properties, the calculation is transparently executed on the server.
The key aspect of your issue, is that you want to execute on the client, a code which has been defined on the server. Therefore, the execution will have to hapen on the server side.
Hope I helped!