Solved

forms authentication, log out button

Posted on 2006-11-07
5
514 Views
Last Modified: 2009-12-16
Hello,
I am using ASP.NET 1.1 and just tried my hand at forms authentication.  I want the 'logo' image, the 'Log out' button, and the Label having text as ("Hello " + User.Identity.Name")  to appear on every page once the user is logged in.  I don't know what's the best way to achieve this.

I created one page with just these three controls and showed this page as a frame at the top once the user has logged in. But I don't want this top frame to appear when the user is not logged in and the 'login.aspx' page should appear in the whole window then.

If a page other than the login.aspx page is requested after the logout, the control goes to the login page as desired. But the problem is since any other window (except the one having login.aspx page) contains two frames, two login.aspx pages are opened, one in each frame. How do I redirect a request to any window(which is containing two frames = two aspx pages) after logout to just one whole frame containing the login.aspx page?

or is there a better solution than using frames?
Please help. Thank you.
0
Comment
Question by:engg
  • 3
  • 2
5 Comments
 
LVL 12

Accepted Solution

by:
sandip132 earned 500 total points
ID: 17895111
You have "usercontrol" as a best option.... Just add youe logo , button and label in a usercontrol. and just include it in your webpages.

http://www.codersource.net/asp_net_user_controls_azam.aspx
http://www.c-sharpcorner.com/Security/LoginUserControl.asp
0
 

Author Comment

by:engg
ID: 17895414
Thanks Sandip.
I thought frames would be an easier option than creating a panel on every page and adding the user control to the panel. Please correct me if I am wrong.

Could this problem be solved if I continue to use frames? or is there any other way?
Thanks.
0
 
LVL 12

Expert Comment

by:sandip132
ID: 17896073
I am not talking about Panel. I am refering to use user-control. Please visit the links, so that you will get better idea.  For your requirement User control is a very good option.
0
 

Author Comment

by:engg
ID: 17902884
Ok. Thanks Sandip. If I want to position the user control on a web form, I will need to add a placeholder (like a panel) to every web form and then add a user control to the placeholder, right?
0
 
LVL 12

Expert Comment

by:sandip132
ID: 17911235
Not required.... you can just drag n drop and use like any other web control.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have developed many web applications with asp & asp.net and to add and use a dropdownlist was always a very simple task, but with the new asp.net, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question