C# to Javascript