Author: David55 | Posted on: 6/11/2008 1:50:35 PM | Views : 603

If I have a label control in a form:

<form Id="form1" runat="server"><asp:Label Id="lblMessage" Text="" runat="server"></asp:Label></form>

I can access it within the _Default class that is automatically created by VS2005, but if I create my own class, say

public class MyClass : _Default

{

         lblMessage.Text = "something";

}

then I get a null object error. The control appears in the "code completion" thingy of the IDE if I have the base class of MyClass set to _Default, but I can't do anything with it.

Really still getting my feet wet with ASP.

Thanks in advance.

David 

 

 
...

Go to the complete details ...