R
Ranginald
Hi,
I have two pages.
Default.aspx
....Codefile="default.aspx.cs" Inherits="Web" %>
and
Sculpture.aspx
....Codefile="default.aspx.cs" Inherits="Sculpture" %>
--------------------------------------------------------------
and the default.aspx.cs file has two classes:
public partial class Web : System.Web.UI.Page
{
Page_Load(.....................)
{
// loads some navigation controls to be used for the entire site
// these controls are dropdownlists
// ddlCategory, ddlSculpture
Method1() //processes navigation selections
Method2( )//processes navigation selections
[this all works fine on the default.aspx page when Web is the only
class in the .cs file]
and I have the inherited class
public partial class Sculpture: Web
{
Page_Load(..............)
{
//loads some repeater controls to display data in the editable
part of the web page
base.Page_Load(sender, e)
}
Method1()//processes user selection from the repeater
}
--------------------------------------------------------------
There is a page_load method in the Web Class that load some navigation
items for use in the entire site.
The Products class adds its own methods to its own Page_Load and then
has a base.Page_Load(sender, e);
--------------------------------------------------------------
THE PROBLEM:
=============
When I try to run the default.aspx page, I get the error:
----> The name 'repeaterOdd' does not exist in the current context
The repeaterOdd is a method I have but it is only "mentioned" in the
Products class so I don't get how the Web class even knows about it
(other than that the two classes are in the same .cs file).
Similarly,
When I run the page Products.aspx I get the same type of error:
----> The name 'ddlCategory' does not exist in the current context.
Technically, the Products.aspx page should know about the ddlCategory
object because this involves code that I *thought* I referenced by
using the base.Page_Load,,,, directive.
It's as if the .aspx pages are just "reading" straight through the .cs
page and ignoring any directives as to what class to use and where to
stop.
Any advice as to what is happening here?
Thanks.
I have two pages.
Default.aspx
....Codefile="default.aspx.cs" Inherits="Web" %>
and
Sculpture.aspx
....Codefile="default.aspx.cs" Inherits="Sculpture" %>
--------------------------------------------------------------
and the default.aspx.cs file has two classes:
public partial class Web : System.Web.UI.Page
{
Page_Load(.....................)
{
// loads some navigation controls to be used for the entire site
// these controls are dropdownlists
// ddlCategory, ddlSculpture
Method1() //processes navigation selections
Method2( )//processes navigation selections
[this all works fine on the default.aspx page when Web is the only
class in the .cs file]
and I have the inherited class
public partial class Sculpture: Web
{
Page_Load(..............)
{
//loads some repeater controls to display data in the editable
part of the web page
base.Page_Load(sender, e)
}
Method1()//processes user selection from the repeater
}
--------------------------------------------------------------
There is a page_load method in the Web Class that load some navigation
items for use in the entire site.
The Products class adds its own methods to its own Page_Load and then
has a base.Page_Load(sender, e);
--------------------------------------------------------------
THE PROBLEM:
=============
When I try to run the default.aspx page, I get the error:
----> The name 'repeaterOdd' does not exist in the current context
The repeaterOdd is a method I have but it is only "mentioned" in the
Products class so I don't get how the Web class even knows about it
(other than that the two classes are in the same .cs file).
Similarly,
When I run the page Products.aspx I get the same type of error:
----> The name 'ddlCategory' does not exist in the current context.
Technically, the Products.aspx page should know about the ddlCategory
object because this involves code that I *thought* I referenced by
using the base.Page_Load,,,, directive.
It's as if the .aspx pages are just "reading" straight through the .cs
page and ignoring any directives as to what class to use and where to
stop.
Any advice as to what is happening here?
Thanks.