Click here to Skip to main content
15,867,330 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a logout link in master page and want to logout the user using that anchor tag. how can this be done?
any help will be appreciated.
Posted

Agreed With First Solution "Use Link Button Instead Anchor Tag"

If You Really Want To Use Anchor Tag Then Set Href To Aspx Page And On That Page Write Code Of LogOut.
 
Share this answer
 
Comments
Nandakishore G N 2-Jul-14 5:31am    
good suggestion. anudeep. My 5..
There are few options, You can redirect user to some other page for example Logout.aspx and sign out the user on page load of that page. check
This Answer for more information[^]
Another option is you can use Linkbutton instead or anchor tag
ASP.NET
<asp:LinkButton runat="server" Text="Log Out" OnClick="LogOut_Click" ></asp:LinkButton>

you can do the sign out in code behind method called LogOut_Click
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900