Exception of type System.StackOverflowException was thrown. PROBLEM

  • Thread starter Thread starter Savas Ates
  • Start date Start date
S

Savas Ates

I want to change my controls in my class
I have the following code. All the code in my _default page class

How can i solve it ?


public class antu:_default

{


public void GetHolder()

{


if ( (string)this.Page.Session["refcode"]=="antu")

{


Control ANTUUST = this.LoadControl("Skin/ANTUUST.ascx");

Control ANTUALT = this.LoadControl("Skin/ANTUALT.ascx");

this.ANTUUSTHOLDER.Controls.Add (ANTUUST);

this.ANTUALTHOLDER.Controls.Add (ANTUALT);



}




}





}



antu AntuHolder =new antu ();




private void Page_Load(object sender, System.EventArgs e)

{



// REFCODE KONTROLU


////////////////////////////////

string refcode;


refcode=Request.QueryString["refcode"];



if ( refcode!=null && Session["refcode"]==null)

{

refcode=refcode.ToLower();

Session["refcode"]=refcode;






}



AntuHolder.GetHolder();
 
That exception is usually caused by an eternal loop. Probably in some of
your user controls, but it's hard to say without seeing any of the
information provided in the error message.
 
Back
Top