Hi all,
I have a class at server-side like this :
public class Address
{
public Address(string countryCode)
{
this._CountryCode = countryCode;
}
private string _CountryCode = string.Empty;
public string CountryCode
{
get { return _CountryCode; }
set { _CountryCode = value; }
}
}
and I have a method that called by Ajax methods :
[AjaxMethod]
public static Address ValidateAddress(Address address)
{
// Some logic here...
return address;
}
And I want to call this method in client side, but how can I instantiate the Address class in client side ? I do not want to define a class named Address in javascript file.
<script>
function valaddress(){
var address = new Address(); // I'm asking here ??
address.CountryCode = 90;
// This part is ok, no problem in here :
var validatedAddress = AddressControlDataHelper.ValidateAddress(address).value;
}
</script>
Are there a way to do this ? or do I need to write my Address class in javascript ?
thanks for your help !