Click here to Skip to main content
15,897,371 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I have been working with an application for more that 2 years, we have nearly 60 forms. Initially client requested to redirect to log in page if the session expires. But now they want us to show a log in popup when the user press a control (like button). What I am doing is checking the session on the page load and display a popup using javascript. I just want to stop the execution cycle in the page load itself. please see the below code.

HTML

ASP.NET
<asp:Button ID="button" runat="server" onclick="button_Click" Text="Check" /> 


C# Code:

C#
protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["User"] != null)
            {
                //Page load function
            }
            else
            {
                //Here i will call the Jquey Popup that I have created
                //I dont want to continue this execution process by calling button_Click
            }
        }

        protected void button_Click(object sender, EventArgs e)
        {
            //Save contition
        }


is there any way to stop the execution cycle in that else condition. Please give me suggestion for this scenario or please let me know idea to do this.
Posted

1 solution

Redirects to a stand-by page. This page must save the original url and it should be the owner of pop-up login form.

After validating the user, redirects to the original url again.
 
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