Getting Stack overflow error in asp.net webform

Hi ,
i have created an application in asp.net 3.5.While i am using crosspage posting i have seen the page load function is happening twice and some times i am getting error message like stack overflow at line 0.Really i have no clue about this kind of error.can any one suggest me how to get this probem to be solved.
tanu80Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

tiagosalgadoCommented:
Your page_load function occurres twice in what page?
What code do you have there ?
0
TechTiger007Commented:
Stack overflow happens some times when your code goes into an infinite loop. Check your logic to see if there is any possibility of infinite loops
0
tanu80Author Commented:
i am using this code for otherinformation page in my application
 String _callbackResult = String.Empty;
        String strFolderPath = Common1ext.Common.Config.GetAppSettingsFromWebConfig("Profile_thumbnail");
        String strMyPID = string.Empty;

        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["Username"] == null)
            {
                Response.Redirect("Login.aspx");
            }
            if (!IsPostBack)
            {
                ViewState["PageNumber"] = 1;
                ViewState["PageSize"] = 5;
                ViewState["CurrentPageIndex"] = 0;

                if (Request.QueryString["uid"] != null)
                {
                    String strFID = Utility.DecryptNumber(Request.QueryString["uid"].ToString());
                    if (strFID != "-1")
                    {
                        ViewState["VisitedUserPID"] = strFID;
                        BindUserProfileData(Convert.ToInt32(strFID), (Int32)ViewState["PageSize"], (Int32)ViewState["PageNumber"]);

                        String cbReference = Page.ClientScript.GetCallbackEventReference(this, "arg", "getValueFromServer", "context", "getErrorFromServer", false);
                        String cbscript = "function UseCallback(arg,context){" + cbReference + ";}";
                        Page.ClientScript.RegisterStartupScript(this.GetType(), "UseCallback", cbscript, true);

                    }
                    else
                    {
                        Response.Redirect("PageNotFound.aspx");
                    }
                }
            }
        }
0
TechTiger007Commented:
This code looks fine. I find no reason in the given code for a stack over flow unless if this page is "Login.aspx".

1. check if there is any recursive loops
2. check if there is any page that recursively redirects to itself
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.