N
Nelson F.
I've made a user control (ascx and ascx.cs) that works fine if I use a
session var to pass it value. However, I'd much prefer to set a property
instead so I added a property. The problem is that when I try to access the
property, it generates a StackOverflowException. See the snip from my source
---<snip>----
public string SelectedTab
{
get{ return SelectedTab; }
set{ SelectedTab = value; }
}
private void Page_Load(object sender, System.EventArgs e)
{
if (SelectedTab != null) // Stack exception here.
{
//....do something
}
}
---<snip>---
Am I doing something wrong?
session var to pass it value. However, I'd much prefer to set a property
instead so I added a property. The problem is that when I try to access the
property, it generates a StackOverflowException. See the snip from my source
---<snip>----
public string SelectedTab
{
get{ return SelectedTab; }
set{ SelectedTab = value; }
}
private void Page_Load(object sender, System.EventArgs e)
{
if (SelectedTab != null) // Stack exception here.
{
//....do something
}
}
---<snip>---
Am I doing something wrong?