Click here to Skip to main content
15,867,756 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello Friends,

I have one content page RespondHome.aspx (Using RespondMaster.Master page) I set this page as Set as Start up page. but its given following error.

The page isn't redirecting properly

Firefox has detected that the server is redirecting the request for this address in a way that will never complete.

This problem can sometimes be caused by disabling or refusing to accept cookies.

My Code is -

C#
protected void Page_Load(object sender, EventArgs e)
        {
            if (Session.IsNewSession)
            {
                Response.Redirect("~/RespondHome.aspx");
            }
            if (Session["UserName"] != null)
            {
                //System.Text.StringBuilder sb = new System.Text.StringBuilder();
                //sb.Append("<i class='fa fa-edit'></i>");
                //sb.Append("Welcome");s
                //sb.Append(Session["UserName"].ToString());
                //sb.Append("<i class='fa fa-angle-down'></i>");
                //UserName.InnerText = sb.ToString();
                //UserName.InnerText = "Welcome" +"  "+ Session["UserName"].ToString();
                lblUser.InnerText = "Welcome" + "  " + Session["UserName"].ToString();
                lblUser.InnerText = "Welcome" + "  " + Session["UserName"].ToString();
                lblEnvironment.InnerText = ConnectionInfo.dbname;
            }
        }


Please give me proper solution.
Thanks
Ram.
Posted
Comments
Sinisa Hajnal 26-May-15 8:11am    
If you're redirecting to RespondHome from RespondeHome when your session is new session, you'll go into an infinite loop. Check that your current page is not RespondHome before redirecting there. If it is, just continue execution (or whatever else you need to do)
rameshvar 26-May-15 8:23am    
Hello Sinsia,
yes my code is going in infinite loop.

1 solution

add one more check along with checking the new session, i.e to check if the previous page is not RespondHome.
 
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