Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

Navigating to another page ASPNET Core 2.0

$
0
0

Hi,

I want to navigate to another page from the Index page once the user is authenticated.  I'm getting an error though, "InvalidOperationException" because my Index page uses IndexModel while the page I'm navigating to uses a SoilModel.

Code snippet in Index.cshtml:

@if (SignInManager.IsSignedIn(User))
{
    @await Html.PartialAsync("~/Pages/_SoilSample.cshtml")
}
else
{
  ...
}

The other problem is, I don't really want to use a partial page.  I want to use a regular Razor page with a model.  How do I navigate to it from my current page?

Appreciate any help.


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>