简体   繁体   中英

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM