Solved

forms authentication, log out button

Posted on 2006-11-07
5
482 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Not required.... you can just drag n drop and use like any other web control.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
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 …
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

772 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now