ASP.NET login without username

Can I use the standard ASP.NET access control, but just ask the user to enter a password? I am using a template, but the runtime complains that:

Login1: LayoutTemplate does not contain an IEditableTextControl with ID UserName for the username. 

My real thinking is to add a control with style="display:none;" that seems lame. The existing project already uses FormsAuthentication, so planning for B can minimize my own authentication method.

Update
I have a 2 step login process. Step 1: "Who are you?" and Step 2: "What is the password?"

+4
source share
4 answers

I would be sure that the style with the display: no one launched my own.

+4
source

What functionality do you want from logging in? I assume you will forward your own authentication mechanism? Will you really gain a lot by reusing the input control? If so, set the display style to: none.

Edit

If you identify the user on the previous page, why not show the disabled text box with the username or part of the username in it? I saw how some banks do this, when on the first page you enter a login and can indicate the state in which you live, then it checks this, and then shows you the first three characters of the login and key of your site and asks for a password.

+3
source

Updated answer :

It is best to convert the entry control to a label, and then display this above the empty text box for your password.

Ye Olde Answer :

Why would you want to do that; What happens if two users have the same password?

+2
source

I have not tested this, and it may seem a little silly, but you can write a wrapper for an input control, such as a UserControl named LoginForm as a property. Then use the Init event to assign values ​​from the controls that you create to update the values ​​to the LoginForm property (property)

If the property does not work, you can place it on the page, but make it hidden.

+1
source

Source: https://habr.com/ru/post/1286225/


All Articles