R
Ranginald
I am learning OOP and C# and am using VWDExpress to create some
practice examples to understand inheritance. Could someone explain why
the following is happening:
I get the error: 'The type or namespace _Default does not exist in the
namespace "Lefantze"'
Here is the code:
default.aspx.cs | in the default.aspx page
inherits="Lefantze._Default"
===========.
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
namespace Lefantze
{
public partial class _Default : System.Web.UI.Page
{
public void Page_Load(object sender, EventArgs e)
{
Label1.Text = "Lefantze test: _Default class";
}
}
Now I try to inherit from _Default in the second class, Default2
default2.aspx.cs | in the default2.aspx.cs page the
inherits="Lefantze.Default2"
======
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
namespace Lefantze
{
public partial class Default2: Lefantze._Default
{
protected void Page_Load(object sender, EventArgs e)
{
}
}
}
Thanks!
practice examples to understand inheritance. Could someone explain why
the following is happening:
I get the error: 'The type or namespace _Default does not exist in the
namespace "Lefantze"'
Here is the code:
default.aspx.cs | in the default.aspx page
inherits="Lefantze._Default"
===========.
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
namespace Lefantze
{
public partial class _Default : System.Web.UI.Page
{
public void Page_Load(object sender, EventArgs e)
{
Label1.Text = "Lefantze test: _Default class";
}
}
Now I try to inherit from _Default in the second class, Default2
default2.aspx.cs | in the default2.aspx.cs page the
inherits="Lefantze.Default2"
======
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
namespace Lefantze
{
public partial class Default2: Lefantze._Default
{
protected void Page_Load(object sender, EventArgs e)
{
}
}
}
Thanks!