Click here to Skip to main content
15,913,709 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
I am working on a live Project and i am having a problem in a issue that

"Home Page - Require all viewers of the page to login - show login popup over grayed out home page. If you are not logged in, you should not be able to view anything!"

Now please help me figure out this issue
as soon a s possible

Thanks,
Jasmeet Singh
Posted

HI ,

Please download the Graybox popup or other j-Query for popup window.

Gray Box

When home page is loading at that time in page_load event you can check
User is log in or not (Using User Session i.e. Session["User"] != null )

if User is not log in then you will Open this Pop up window using JavaScript code .

Page.ClientScript.RegisterStartupScript(Page.GetType(), "Popup", "GB_show(caption, your login page, height, width, callback_fn)", true);
 
Share this answer
 
v2
Generally developers do following:

As soon as user is logged-In, UserId is saved in Session.
On Page_Load event check weather UserId in sessions is null or not.
If it is null then redirect to Login Page.

C#
protected void Page_Load(object sender, EventArgs e)
{        
   if (!IsPostBack)
   {
       // Check here for Logged-in userid.
   }
}


Mark as answer, if it is helpful to you.
 
Share this answer
 

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