larrydotnet:
Yes Zhao, in fact i did it. Making a single master page available for many other web projects (using IIS virtual directory).
It works fine "referencing" the master page and also "running" child pages. The problem is when i am designing and programing a child page in VS, i can not access public properties or methods from the master page.
Only controls defined in the master page can be acceced from the child page using de FindControl method, i think it is because in the child page i dont have the TYPE of the external master page, maybe there could be a way to cast the master doing something like ctype(page.master, [ whatever type]).mypropertyOrMethod=something
Maybe there is a special attribute in the MasterType declarative keyword that can help, maybe not...
Any ideas?
Thanks
Public properties can be accessed from master page in underlying pages, by just calling the property like so
say there is public property name divAccess you can access it by
Master.divAccess and if it returns something you can even execute methods on it..
like Master.divAccess.clear();
You do need a @MasterType VirtualPath="~/Your.master" directive in the callee page aspx
For nested master pages you need to do a cast to reach the top page and this could be... (NAMEOFMASTERCLASS)(page.master.master)
Please Mark Post that helped you as answer, also include a summary of what solved the problem as it helps others in similar situations