C
C#8mo 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
op1511OP8mo ago
or just call directly with fetch?
Angius
Angius8mo ago
Eithet that, or use a dummy element and store it in the data- attributes
op1511
op1511OP8mo ago
ok
Want results from more Discord servers?
Add your server