By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,952 Members | 1,686 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,952 IT Pros & Developers. It's quick & easy.

How to login from code view?

P: n/a
I know this must be simple, but i can't figure it out.

i'm creating user's from the code view using code similiar to this..

......
If Membership.RequiresQuestionAndAnswer Then
newUser = Membership.CreateUser( _
UserName.Text, _
Password.Text, _
Email.Text, _
Question.Text, _
Answer.Text, _
True, _
result)
Else
newUser = Membership.CreateUser( _
UserName.Text, _
Password.Text, _
Email.Text)
End If
If result = MembershipCreateStatus.Success Then
'log in user...
end if

i would like to login the user if the account is created. is ther some
library that i can include that has a login function?

maybe login(username,password)?

thanks for any help.
Mar 20 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
I think you can do it like this:

FormsAuthentication.SetAuthCookie _
(UserName.Text, True)

Let us know if this helps?

Ken
Microsoft MVP [ASP.NET]
"Fabuloussites" <Fa***********@discussions.microsoft.com> wrote in message
news:8B**********************************@microsof t.com...
I know this must be simple, but i can't figure it out.

i'm creating user's from the code view using code similiar to this..

.....
If Membership.RequiresQuestionAndAnswer Then
newUser = Membership.CreateUser( _
UserName.Text, _
Password.Text, _
Email.Text, _
Question.Text, _
Answer.Text, _
True, _
result)
Else
newUser = Membership.CreateUser( _
UserName.Text, _
Password.Text, _
Email.Text)
End If
If result = MembershipCreateStatus.Success Then
'log in user...
end if

i would like to login the user if the account is created. is ther some
library that i can include that has a login function?

maybe login(username,password)?

thanks for any help.

Mar 20 '06 #2

P: n/a
Thanks a million. I knew there had to be a simple solution :).

"Ken Cox - Microsoft MVP" wrote:
I think you can do it like this:

FormsAuthentication.SetAuthCookie _
(UserName.Text, True)

Let us know if this helps?

Ken
Microsoft MVP [ASP.NET]
"Fabuloussites" <Fa***********@discussions.microsoft.com> wrote in message
news:8B**********************************@microsof t.com...
I know this must be simple, but i can't figure it out.

i'm creating user's from the code view using code similiar to this..

.....
If Membership.RequiresQuestionAndAnswer Then
newUser = Membership.CreateUser( _
UserName.Text, _
Password.Text, _
Email.Text, _
Question.Text, _
Answer.Text, _
True, _
result)
Else
newUser = Membership.CreateUser( _
UserName.Text, _
Password.Text, _
Email.Text)
End If
If result = MembershipCreateStatus.Success Then
'log in user...
end if

i would like to login the user if the account is created. is ther some
library that i can include that has a login function?

maybe login(username,password)?

thanks for any help.


Mar 20 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.