prvnsaini prvnsaini - 1 month ago 6x
JSON Question

Identity Server DefaultViewService JSON issue

I am trying to replace login page with custom login page using below link

Note - I am not facing this issue when i use partial view.

But my model Json is kind of wired, I am unable to get property value using {{model.logoutUrl}}

Image showing model.logout url As is

Strange but model is present but i am not able to get that value because it seems it has 2 curly braces and invalid JSON. [![Image showing model JSON][2]][2]

Any help will be really helpful. Thanks.


If you're making use of full views (like login.html as opposed to the partial _login.html which makes use of the layout.html), make sure to include the full model, and the identityserver js scripts that picks up the model and uses the templating of Angular to render the views yourself in each view.

<script id='modelJson' type='application/json'>{model}</script>
<script src="{applicationPath}/assets/scripts.2.5.0.js"></script> (or whatever version you're on)

Or in other words: when you're not using the partials, you will need to do whatever is normally in the layout file in each view.