one final question relating to the login page. How do I change the background image?
I assume I could replace login.png and login-dark.png in *.Web.Mvc\wwwroot\metronic\assets\media\svg\illustrations
But also assumed I could edit path in *.Web.Mvc\Views\TenantRegistration_Layout.cshtml, but this method doesn't work?
Okay thanks, rearrange my code and now have it working.
One final question - when logging out how can I have it redirect back to my startup page rather than going back to /Account/Login
Thank you for your response.
So I have added my new page and its controller as documented in previous reply - called Startup.
I have now edited the correct HomeController.cs as below, but when running I get error as below about not being logged on, but the whole point is I don't want to have to be logged on to see this first page
using System.Threading.Tasks;
using Abp.Runtime.Session;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using PCADemo.Identity;
using PCADemo.Web.Controllers;
namespace PCADemo.Web.Controllers
{
public class HomeController : PCADemoControllerBase
{
private readonly SignInManager _signInManager;
public HomeController(SignInManager signInManager)
{
_signInManager = signInManager;
}
public async Task<IActionResult> Index(string redirect = "", bool forceNewRegistration = false)
{
if (forceNewRegistration)
{
await _signInManager.SignOutAsync();
}
if (redirect == "TenantRegistration")
{
return RedirectToAction("SelectEdition", "TenantRegistration");
}
return AbpSession.UserId.HasValue ?
RedirectToAction("Index", "Home", new { area = "App" }) :
RedirectToAction("Index", "Startup", new { area = "App" }); // You can specify it on the application opening page
}
public IActionResult WelcomePage()
{
return View();
}
}
}
Thanks for reply.
My project is MVC.
I created a new controller (.Web.Mvc\Areas\App\Controllers\StartupController.cs) and a new page (.Web.Mvc\Areas\App\Views\Startup\Index.cshtml), but can't see to work out how to change the HomeController to load that new page first correctly as currently HomeController has [AbpMvcAuthorize] and code to check various criteria as to what page to load, even removing the [AbpMvcAuthorize] and setting it to just my page didn't work for me as initially got error. Comments please?