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

Second login form in one solution

$
0
0

I start use ASP.Net Identity in my app. I have one page (/identity/account/login) where i can type login and password and login to page. But i want create second login page in home page. In home page i have button who create pop-up where i would like create second login form. It is posible?

First login form (deafult):

Second login form (as pop-up in home page):

What I have tried:

In home page i try something like this, but it doesn't work

<partial name="~/Areas/Identity/Pages/Account/Login.cshtml" model="@LoginModel" view-data="ViewData" />

Whats more if click button in popup i create function:

$("#login").click(function () {
        Login();
         });


          function Login() {
              var InputLogin = $('#email').val();
              var InputPassword = $('#password').val();$.ajax({
            type: "POST",
            url: 'Identity/Pages/Login/OnPostAsync',
            data: { "Input.Login": InputLogin, "Input.Email": InputLogin },

            dataType: "json",
            success: function () { alert('Ok'); },
            error: function () { alert('Don't ok'); },
        });
        }


Viewing all articles
Browse latest Browse all 9386

Trending Articles



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