Question

Is it possible to use the standard ASP.NET login control, but just ask the user for 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 current thinking, is to add the control with style="display:none;" which seems lame. The existing project already uses FormsAuthentication, so plan B might be to roll my own Authentication method.

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

Was it helpful?

Solution

I'd sure style it with display:none long before rolling my own.

OTHER TIPS

What functionality do you want from the Login Control? I assume your rolling your own authentication mechanism? Are you really going to gain a lot by reusing the login control? If so set the style to display:none.

Edit

If you identify the user on a previous page why not show a disabled textbox with the username or part of the username in it? I've seen some banks do this where on the first page you put the login and maybee the state you live in, then it validates that, then shows you the first three characters of the login name, and your site key and asks for your password.

Updated Answer:

Your best bet is to transform the login control into a label, and then display that over the empty textbox for their password.

Ye Olde Answer:

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

I haven't tested this, and it may sound a little silly, but you might be able to write a wrapper for the login control, like a UserControl with a LoginForm as a property - Then use the Init event to assign values from the controls you create to update the values onto the LoginForm (property)

If the property doesn't work, you might be able to put it on the page, but make it hidden.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top