views:

71

answers:

1

Hi there,

so I've got the following structures;

Start.master (Start.master.cs)

Contains a Method

DoSomething(string Text)
{
    _MyHtmlControl.InnerText = Text;  
}

And the HtmlGenericControl ID'ed *MyHtmlControl

Page.aspx (Page.aspx.cs)

Calls the Method via new Start().DoSomething("Test");

Doing so gives me the following error: Object reference not set to an instance of an object.

How can I make it work, so I can call DoSomething() and it writes the given string into the HtmlGenericControl that is defined in the MasterPage?

+1  A: 

See:

ASP.Net Master Pages: Tips, Tricks, and Traps

Abstract Interaction

Now it’s time to have the master page and content page interact. There are different approaches we can take to achieve interaction, but the best approaches are the ones that use the master page for what it is: a user control.

richeym
Thanks a lot, how come you never find such useful sites when searching by your own? -.-"
ApoY2k