473,385 Members | 1,582 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

How to login from code view?

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
2 964
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Wayne Smith | last post by:
Applies to: Microsoft FrontPage 2000, Microsoft Access 2000, IIS 5.0 Operating System: Microsoft Windows 2000 Professional I am trying to protect a portion of a web site by allowing users to...
1
by: anonymous | last post by:
Hi all, I've been searching the way to achieve the following task. But no luck so far. I have a web site(main site), which requires authentication. This authentication is set at Windows...
4
by: nicholas | last post by:
Hi, Got an asp.net application and I use the "forms" authentication mode defined in the web.config file. Everything works fine. But now I would like to add a second, different login page for...
9
by: dana lees | last post by:
Hello, I am developing a C# asp.net application. I am using the authentication and authorization mechanism, which its timeout is set to 60 minutes. My application consists of 2 frames - a...
1
by: Friends | last post by:
Hi I need to set security for row level but not based on Database user's login. It should be based on the user table login. For the particular user I need to allow only the particular records to...
6
by: AppleBag | last post by:
I'm having the worst time trying to login to myspace through code. Can someone tell me how to do this? Please try it yourself before replying, only because I have asked this a couple of times in...
1
by: xcelmind | last post by:
Hello Dev. Guru, I want to at this time introduce myself. I am Stanley Ojadovwa by name. I’m a freelance and a newbie in web application development. I’m currently using ASP as my application...
0
by: Jacob Donajkowski | last post by:
Once the user logs in I want to have the users switch from the Roster View to the Profile View and enter their profile infomation and save it. Then the next time they login and go to the Profile...
9
by: Ben | last post by:
Hello, I'll bet this has been asked a million times but I can't seem to find a thread that gives the clear example I need. This PC has MySQL and IIS configured and running. The MySQL database is...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.