Your C# class
public class City
{
private string name;
public string Name
{
get
{
return name;
}
set
{
name = value;
}
}
private int population;
public int Population
{
get
{
return population;
}
set
{
population = value;
}
}
}
The same class object in JavaScript
<script type = "text/javascript">
var city = {};
city.Name = "Mumbai";
city.Population = 2000;
alert(city.Name);
alert(city.Population);
</script>