Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

forms authentication, log out button

Posted on 2006-11-07
5
Medium Priority
?
544 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 1500 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

963 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