R
Ranginald
I am new to oop so please bear with me:
Could someone please explain to me why the "protected void
runCategory() method" cannot access the local ddlCategory object that
is easily accessed in the "createNav() method"? I thought that because
they are in the same class, that the ddlCategory object would be
accessible to all methods in this class.
Here is the code snippet:
public partial class Main: System.Web.UI.Page
{
public void Page_Load(object sender, EventArgs e)
{
createNav();
}
public void createNav();
{
//code for navigation for web pages -- two dropdownlists,
ddlCategory and ddlSculpture
}
protected void runCategory();
{
//definition for ddlCategory selection
}
protected void runSculpture();
{
//definition for ddlSculpture selection
{
Thanks!
Could someone please explain to me why the "protected void
runCategory() method" cannot access the local ddlCategory object that
is easily accessed in the "createNav() method"? I thought that because
they are in the same class, that the ddlCategory object would be
accessible to all methods in this class.
Here is the code snippet:
public partial class Main: System.Web.UI.Page
{
public void Page_Load(object sender, EventArgs e)
{
createNav();
}
public void createNav();
{
//code for navigation for web pages -- two dropdownlists,
ddlCategory and ddlSculpture
}
protected void runCategory();
{
//definition for ddlCategory selection
}
protected void runSculpture();
{
//definition for ddlSculpture selection
{
Thanks!