C
C#7mo 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)); ^ is this a good way
3 Replies
op1511
op1511OP7mo ago
or just call directly with fetch?
Angius
Angius7mo ago
Eithet that, or use a dummy element and store it in the data- attributes
op1511
op1511OP7mo ago
ok
Want results from more Discord servers?
Add your server