I am creating the site using the following steps.
Install-Package HotTowel
and update all code using NeGet.When I run the code.
HotTowel\index.cshtml
instead of the page Home\Index.cshtml which has login code. HotTowel\index.cshtml
is wrapped in the generated html code of Shared\_Layout.cshtml
. What I want is
The site shows the login page first, and redirect to the HotTowel home page after logged in.
I tried to Install HotTowel on a pre-created built-in SPA project and got the similar issues.
I found that commenting out the following lines in the file HotTowelRouteConfig.cs
will make sure the start page go to Home\Index.cshtml
.
[assembly: WebActivator.PreApplicationStartMethod(
typeof(test4.App_Start.HotTowelRouteConfig), "RegisterHotTowelPreStart", Order = 2)]
in your global.asax you need to add new route
routes.MapRoute(
"Default", // Route name
"{controller}/{action}/{id}", // URL with parameters
new { controller = "Account", action = "Login", id = "" } // Parameter defaults
);
and your login ends on return Redirect("/");
or return RedirectToAction("HotTowel","index");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With