Add login button to MVC home page
-
New to MVC I want to add a Login button to my home page that mimics the built in login on the menu bar. Just want to give the user an option. Thanks
-
New to MVC I want to add a Login button to my home page that mimics the built in login on the menu bar. Just want to give the user an option. Thanks
There are millions of ways of doing this. Do you have a specific question?
There are two kinds of people in the world: those who can extrapolate from incomplete data. There are only 10 types of people in the world, those who understand binary and those who don't.
-
There are millions of ways of doing this. Do you have a specific question?
There are two kinds of people in the world: those who can extrapolate from incomplete data. There are only 10 types of people in the world, those who understand binary and those who don't.
I know there are many ways to do most things in programming. I created an MVC app with Identity - Individual account. I want to keep the main menu login and just add an alternate login button/link on the homepage. Wish I could be more specific. Searches just bring up "Custom Login Pages", which I am not trying to do.
-
I know there are many ways to do most things in programming. I created an MVC app with Identity - Individual account. I want to keep the main menu login and just add an alternate login button/link on the homepage. Wish I could be more specific. Searches just bring up "Custom Login Pages", which I am not trying to do.
MichaelLuna wrote:
just bring up "Custom Login Pages", which I am not trying to do.
But you are doing a custom login page.
MichaelLuna wrote:
just add an alternate login button/link on the homepage.
So, add a link or a button. I'm not sure what the problem is.
There are two kinds of people in the world: those who can extrapolate from incomplete data. There are only 10 types of people in the world, those who understand binary and those who don't.
-
New to MVC I want to add a Login button to my home page that mimics the built in login on the menu bar. Just want to give the user an option. Thanks
You add the button in the same way that you add any other link:
@Html.ActionLink("Log in", "Login", "Account", routeValues: null, htmlAttributes: new { @class = "btn btn-default" })
Or:
<a class="btn btn-default" href="@Url.Action("Login", "Account")">Log in</a>
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
-
You add the button in the same way that you add any other link:
@Html.ActionLink("Log in", "Login", "Account", routeValues: null, htmlAttributes: new { @class = "btn btn-default" })
Or:
<a class="btn btn-default" href="@Url.Action("Login", "Account")">Log in</a>
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
Thank You. Exactly what I needed. Both examples gave me a better understanding of the how the view refers to the controller. Sorry for such a basic question. I'm sure my questions will get more sophisticated in time. The move to MVC from WPF is much harder than I imagined.