Search
Get Started
C
C#
•
2y ago
op1511
what is the best way to access the Model object in a razor view, in a javascript?
var model = @Html.Raw(Json.Encode(Model));
var model = @Html.Raw(Json.Encode(Model));
^ is this a good way
C#
Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,110
Members
View on Discord
Similar Threads
Was this page helpful?
Yes
No
var model = @Html.Raw(Json.Encode(Model));
var model = @Html.Raw(Json.Encode(Model));
Similar Threads
What is the correct way to bind a view model to a view?
C
C# / help
2y ago
What is best practice to pass model information between razor pages?
C
C# / help
14mo ago
❔ Razor pages view
C
C# / help
3y ago
❔ What is the Best Way to convert the nested C# object to key value pair
C
C# / help
3y ago