Currently the identity scaffolder updates the app layout with the following code to add the login partial:
<div class="navbar-collapse collapse">
@{
var result = Engine.FindView(ViewContext, "_LoginPartial", isMainPage: false);
}
@if (result.Success)
{
await Html.RenderPartialAsync("_LoginPartial");
}
else
{
throw new InvalidOperationException("The default Identity UI layout requires a partial view '_LoginPartial' " +
"usually located at '/Pages/_LoginPartial' or at '/Views/Shared/_LoginPartial' to work. Based on your configuration " +
$"we have looked at it in the following locations: {System.Environment.NewLine}{string.Join(System.Environment.NewLine, result.SearchedLocations)}.");
}
</div>
We should review this code and make share it is appropriate for all layouts.
@javiercn
@danroth27 - I am getting this error while using Identity as UI feature. I added all necessary steps but after opening the Register link I am getting - "The default Identity UI layout requires a partial view '_LoginPartial' usually located at '/Pages/_LoginPartial' or at '/Views/Shared/_LoginPartial' to work. Based on your configuration we have looked at it in the following locations: "
Any suggestions?
@danroth27 I believe this is fixed in RTM. @seancpeters can you confirm?
@danroth27 @javiercn - I am unable to cause an error like this from exploratory testing with the latest bits. If there's a specific scenario you'd like me to test, please let me know. The changes to the logic of where to look for & place scaffold pages, as well as unrooting (removing the lead slash) from the path to the Layout in _ViewStart fix this issue in all scenarios I've tested.
It is 2018, and you decided to hard code a reference to a "_LoginPartial" in your code ! Wow!
Why do you keep changing things that are working, especially if you can't give a seamless upgrade ... This is wasting time to figure out where the reference to this file is & how to get rid of it - if at all possible. Further, it seems to generate its own templated page .. who asked for all of this brilliancy from your side ? (The assumption seems to be that there is always a "Layout" page -- why has this assumption been made (regardless of "best" practices) ?
Hi @phantom2017-Nov. I'd like to help out. Can you tell me more about what you're trying to do and which changes specifically are causing you issues?
Can this issue (fixed in RTM) be closed? cc @seancpeters
@danroth27 - this is a content issue, so I'd leave it to you to close it if appropriate.
@HaoK - Do you know if this already fixed?
It works for:
@Rick-Anderson do you think we can close this then? Are there scenarios that doesn鈥檛 work?
Close it. We get alot of traffic and comments on that topic.
That page gets 18.5 PV/month.
Most helpful comment
It is 2018, and you decided to hard code a reference to a "_LoginPartial" in your code ! Wow!
Why do you keep changing things that are working, especially if you can't give a seamless upgrade ... This is wasting time to figure out where the reference to this file is & how to get rid of it - if at all possible. Further, it seems to generate its own templated page .. who asked for all of this brilliancy from your side ? (The assumption seems to be that there is always a "Layout" page -- why has this assumption been made (regardless of "best" practices) ?