Mam takie pytanie na temat dręczonego mnie problemu stworzyłem sobie prosty formularz w ASP
<body>
<form id="form1" method="post" runat="server">
<div>
<asp:Menu runat="server" ID="MenuBar" Orientation = "Horizontal" Width = "100%" ></asp:Menu>
<asp:label ID="Label1" runat="server" text=""></asp:label>
</div>
</form>
</body>
A kod wygląda następująco
public class controls : WebForm1
{
public void menu()
{
MenuBar.Items.Add(new MenuItem("Janek"));
}
}
public partial class WebForm1 : System.Web.UI.Page
{
public void Page_Load(object sender, EventArgs e)
{
Label1.Text = "Session";
}
}
Problem polega na tym iż kontroli mimo iż dziedziczone, w klasie controls zwracają mi błąd NULL Object reference not set to an instance of an object. I nie mam pojęcia co z tym począć :o