473,507 Members | 2,473 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to Sign Out in Asp.Net 2.0?

Hello,

In my web site I am using Asp.Net 2.0 and "Membership.ValidateUser" to
login a user.
I didn't use the login controls. I created my own custom look login and
used membership API.

I created an image button which says logout. How to I make it logout
when it is pressed.
I tried to find a function similar to "Membership.ValidateUser" but to
logout. I wasn't able to find it.

Thanks,
Miguel

Mar 19 '06 #1
5 6036
Miguel,
If it is using Forms Authentication as I suspect you are, the
FormsAuthentication class has a very handy SignOut method.

Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Miguel Dias Moura" wrote:
Hello,

In my web site I am using Asp.Net 2.0 and "Membership.ValidateUser" to
login a user.
I didn't use the login controls. I created my own custom look login and
used membership API.

I created an image button which says logout. How to I make it logout
when it is pressed.
I tried to find a function similar to "Membership.ValidateUser" but to
logout. I wasn't able to find it.

Thanks,
Miguel

Mar 19 '06 #2
See :

http://aspnet.4guysfromrolla.com/articles/120705-1.aspx
and
http://msdn.microsoft.com/msdnmag/is...NET20Security/

Basically, look into LoginControl.Logout

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"Miguel Dias Moura" <md*REMOVE*moura@gmail*NOSPAM*.com> wrote in message
news:O%****************@TK2MSFTNGP11.phx.gbl...
Hello,

In my web site I am using Asp.Net 2.0 and "Membership.ValidateUser" to login a user.
I didn't use the login controls. I created my own custom look login and used membership API.

I created an image button which says logout. How to I make it logout when it is pressed.
I tried to find a function similar to "Membership.ValidateUser" but to logout. I wasn't able to
find it.

Thanks,
Miguel

Mar 19 '06 #3
Additionally, see :
http://msdn2.microsoft.com/en-us/lib...us(VS.80).aspx

When the user is logged in to the Web site,
the LoginStatus control provides a link to log out of the Web site.

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"Juan T. Llibre" <no***********@nowhere.com> wrote in message
news:uk**************@TK2MSFTNGP12.phx.gbl...
See :

http://aspnet.4guysfromrolla.com/articles/120705-1.aspx
and
http://msdn.microsoft.com/msdnmag/is...NET20Security/

Basically, look into LoginControl.Logout

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"Miguel Dias Moura" <md*REMOVE*moura@gmail*NOSPAM*.com> wrote in message
news:O%****************@TK2MSFTNGP11.phx.gbl...
Hello,

In my web site I am using Asp.Net 2.0 and "Membership.ValidateUser" to login a user.
I didn't use the login controls. I created my own custom look login and used membership API.

I created an image button which says logout. How to I make it logout when it is pressed.
I tried to find a function similar to "Membership.ValidateUser" but to logout. I wasn't able to
find it.

Thanks,
Miguel


Mar 19 '06 #4
Thank you all. It was exactly that what I was looking.

Cheers,
Miguel

"Juan T. Llibre" <no***********@nowhere.com> wrote in message
news:#V**************@TK2MSFTNGP11.phx.gbl:
Additionally, see :
http://msdn2.microsoft.com/en-us/lib...us(VS.80).aspx

When the user is logged in to the Web site,
the LoginStatus control provides a link to log out of the Web site.

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"Juan T. Llibre" <no***********@nowhere.com> wrote in message
news:uk**************@TK2MSFTNGP12.phx.gbl...
See :

http://aspnet.4guysfromrolla.com/articles/120705-1.aspx
and
http://msdn.microsoft.com/msdnmag/is...NET20Security/

Basically, look into LoginControl.Logout

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"Miguel Dias Moura" <md*REMOVE*moura@gmail*NOSPAM*.com> wrote in message
news:O%****************@TK2MSFTNGP11.phx.gbl...

Hello,

In my web site I am using Asp.Net 2.0 and "Membership.ValidateUser" to login a user.
I didn't use the login controls. I created my own custom look login and used membership API.

I created an image button which says logout. How to I make it logout when it is pressed.
I tried to find a function similar to "Membership.ValidateUser" but to logout. I wasn't able to
find it.

Thanks,
Miguel



Mar 19 '06 #5
Hi,

Log on to:http://www.vkinfotek.com

Briefly the code for SignOut

Sub SignOut(ByVal objSender As Object, ByVal objArgs As EventArgs)
'Delete the cookie and signout
FormsAuthentication.SignOut()
'Redirect the user to thieir referring page
Response.Redirect(Request.UrlReferrer.ToString())
End Sub

Regards
Bhar

Mar 20 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
2358
by: cooldv | last post by:
i know how to replace the sign " when SUBMITTING a form in asp by this code: message = Replace(usermessage, "'", "''"). My problem is DISPLAYING data in an asp FORM, from an an access database,...
12
18199
by: tarmat | last post by:
sorry for this silly little question, but whats the function to grab the sign of a value?
37
25298
by: Claude Gagnon | last post by:
Hi, How can we compare sign of numbers in C++ ? Bye, Claude
10
17799
by: Sona | last post by:
Hi, Could someone please explain what sign-extension means? If I have a hex number 0x55, how does this get sign-extended? Can a sign-extended counterpart be equal to -91? In a program I'm...
3
2228
by: Jimmy | last post by:
I'm trying to find a website that does the following: 1. Signs you up to a second site under a different primary domain (i.e. as a result of a checkout or something). The username and password may...
6
1951
by: Steve K. | last post by:
I recall a few months ago coming across an article allowing for encoding (or converting?) xml and html documents into sign language as well as brail for deaf and blind people, and that they were...
11
45189
by: =?ISO-8859-1?Q?Konrad_M=FChler?= | last post by:
Hi, a simple question: Which standard function in c++ gives me the sign of a number? Thanks Konrad
2
4754
by: Terry Chapman | last post by:
I have a 2003 Access .mda add-in which I can sign using my Thawte digital certificate. I am now migrating this add-in to Access 2007 and when I try to add my Thawte digital signature Access 2007...
29
19144
by: Nick | last post by:
I've seen a few frameworks use the following: function $(id) { return document.getElementById(id); } Then to use: $('something').innerHTML = 'blah'; I'm just trying to roll this out to my...
20
2317
by: Ravikiran | last post by:
Hi Friends, I wanted know about whatt is ment by zero optimization and sign optimization and its differences.... Thank you...
0
7109
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
7313
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,...
0
7372
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7481
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5619
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4702
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3179
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1537
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
411
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.