Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Add login button to MVC home page

Add login button to MVC home page

Scheduled Pinned Locked Moved ASP.NET
asp-netarchitecture
6 Posts 3 Posters 7 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    MichaelLuna
    wrote on last edited by
    #1

    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

    Z Richard DeemingR 2 Replies Last reply
    0
    • M MichaelLuna

      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

      Z Offline
      Z Offline
      ZurdoDev
      wrote on last edited by
      #2

      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.

      M 1 Reply Last reply
      0
      • Z ZurdoDev

        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.

        M Offline
        M Offline
        MichaelLuna
        wrote on last edited by
        #3

        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.

        Z 1 Reply Last reply
        0
        • M MichaelLuna

          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.

          Z Offline
          Z Offline
          ZurdoDev
          wrote on last edited by
          #4

          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.

          1 Reply Last reply
          0
          • M MichaelLuna

            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

            Richard DeemingR Offline
            Richard DeemingR Offline
            Richard Deeming
            wrote on last edited by
            #5

            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

            "These people looked deep within my soul and assigned me a number based on the order in which I joined" - Homer

            M 1 Reply Last reply
            0
            • Richard DeemingR Richard Deeming

              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

              M Offline
              M Offline
              MichaelLuna
              wrote on last edited by
              #6

              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.

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups