Search
Star
Feedback
Setup for Free
© 2026 Hedgehog Software, LLC
Twitter
GitHub
Discord
System
Light
Dark
More
Communities
Docs
About
Terms
Privacy
what is the best way to access the Model object in a razor view, in a javascript? - C#
C
C#
•
2y ago
•
3 replies
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.
62,270
Members
View on Discord
Resources
ModelContextProtocol
ModelContextProtocol
MCP Server
Similar Threads
Was this page helpful?
Yes
No
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
16mo ago
❔ Razor pages view
C
C# / help
4y ago
❔ What is the Best Way to convert the nested C# object to key value pair
C
C# / help
3y ago