Modify Login To Add Third Required Field

A

Andrew Hayes

I've setup a test C#.NET web app that correctly uses Membership with the
Login, LoginView and LoginState controls in Visual Studio 2005. I've tested
it thoroughly and it all works as expected, with the User Name and Password.

Then I wanted to add a 3rd field called Department.

By converting the Login to a Template I was able to add the new ASP:Label,
ASP:Textbox and ASP:RequiredFieldValidator tags, and added custom code to
the Authenticate event, but I am not able to retrieve the information from
the new textbox.

I can see Login1.UserName and Login1.Password but not Login1.Department.
What am I missing? How do I get the contents of the new textbox into the
Authenticate event handler so I can do the checking?

Any help would be appreciated. Thank you.
 
G

Guest

Andrew,
Probably the ASP.NET newsgroup would have been more appropriate for your
question. To do what you want, you would have to write a custom Membership
provider class, deriving from the base MembershipProvider in ASP.NET. Scott
Guthrie's blog points to some samples that are available.

Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top