I’m trying to get a WebPage act as the super of all other Webapges i have.
Basicly i’m looking for a MasterPage, that will edited in the IDE, add some controls and have this controls to be seen on any other WebPage i have.
To see a toolbar and a footer on every WebPage.
Can this be done?
Controls on a webpage are not inheritable, only constants, properties, events and methods.
You can put the toolbar on a container control, then include that container on every page. Then you only have to edit the toolbar in one place. Same for footer. Another method is instead of using different pages, make the content area a container and swap in different containers to change the “page”.
[quote=48180:@Jay Madren]Controls on a webpage are not inheritable, only constants, properties, events and methods.
You can put the toolbar on a container control, then include that container on every page. Then you only have to edit the toolbar in one place. Same for footer. Another method is instead of using different pages, make the content area a container and swap in different containers to change the “page”.[/quote]
if you say so, why does it work but only don’t show in the IDE?
It seems that i can make a WebPage1 with a Super of WebPageMaster wich has a toolbar on it to show the toolbar also on WebPage1.
The fact is, the IDE doesn’t show this, it doesn’t show anything other than the default blank page.
Well i guess, it’s working cause it shouldn’t ?
For the showing of the (visible) objects in the IDE that’s something?
Make a container (or containers) for the common controls. Put that container on each page. I think you’ll find that it separates common code well enough.
I guess I’d have to see the visual superclass idea implemented. I can’t imagine how it wouldn’t be confusing, in that somehow, the editor has to distinguish class/window/page controls from super-class/window/page controls. But I don’t have a very good imagination either.
The super will give pre defined controls (just like an ordinary WebPage would have) to any WebPage. Meaning that one could just act af if it was the background but no events or so would be given to the WebPage that makes use of the MasterPage. To interact with the MasterPage you should be able to just call it by it’s name.
@Derk Jochems - The fact that it works is a bug. In the same way that you cannot inherit control instances on a Window in a Desktop project, you shouldn’t be able to do it here. There are a lot of things behind the scenes that I can think of which will have an undefined behavior if you do this.
As was suggested, I’d use WebContainers for the things you want on every page.
[quote=48331:@Greg O’Lone]@Derk Jochems - The fact that it works is a bug. In the same way that you cannot inherit control instances on a Window in a Desktop project, you shouldn’t be able to do it here. There are a lot of things behind the scenes that I can think of which will have an undefined behavior if you do this.
As was suggested, I’d use WebContainers for the things you want on every page.[/quote]
With webcontainers and more than 25+ pages this is not what i want.
If one of those pages need to change some code, or place the container on another location it would take ages.
Pure inefficiency. Look at other tools, they have some AWSOME usefull features, the masterpages is only one of those.