Solved

forms authentication, log out button

Posted on 2006-11-07
5
526 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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 recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

710 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