harishr
harishr

Reputation: 18065

calling master page constructor from content page

I have parameterized constructor for the master page and no default constructor. How can i call the master page constructor from content page constructor.

BaseClass(): Master.Master(x)
or
BaseClass()
{
  Master.Master(x)
}

both does not work

Thanks a lot in advance for help, Harish

Upvotes: 0

Views: 535

Answers (1)

Pascal Piché
Pascal Piché

Reputation: 610

You cannot instantiate the master page your self.

For detailled information : http://msdn.microsoft.com/en-us/library/c8y19k6h.aspx

You can create a property on your master page and set the value from the page constructor

this.Master.YourProperty = Your value

Upvotes: 2

Related Questions