MVC Ustaw zmienną JavaScript z modelu

// Set your c# variables

@model <Your namespace>.MyModel

@{
    int myInt = MyModel.myInt;
    string myString = MyModel.myString;
}

<script>

	//In your js use the razor syntax to call your variables

    var myInt = @myInt;
    var myString = @myString;
    
    //

	var myInt = @MyModel.myInt;
    var myString = @MyModel.myString;

</script>
Av3