Answers
Jul 19, 2007 - 12:35 PM
No Sorry, you can't use masterpages. Two things come to my mind: First, you coul ddo this using inheritance. Create a master usercontrol and then inherit all other controls from this class. The second solution would be to use a Theme. You create a .skin file in a theme (saved to "app_themes") and set the properties you want to be the same for all controls on a page. You then apply the theme to the page like so: <%@ Page Theme="BlueTheme" %>.
I personally would probably chose the inheritance from a base class.
Did this help you?
Cheers
Peter
I personally would probably chose the inheritance from a base class.
Did this help you?
Cheers
Peter
Jul 19, 2007 - 01:07 PM
Thanks, Peter. It's a pity that MS didn't think of making that as easy as the masterpage, since I think it's a pretty obvious thing to want to do.
I found this info on microsofts site: http://msdn2.microsoft.com/en-us/library/36574bf6(vs.80).aspx about templated user controls, I think that's the inherited solution you're talking about. Theming I think is not good enough for me, since I want to be able to not only change colors and other css-styles, but also have some repeated html-code in the tempate.
Do you know about the MS way of doing it?
I found this info on microsofts site: http://msdn2.microsoft.com/en-us/library/36574bf6(vs.80).aspx about templated user controls, I think that's the inherited solution you're talking about. Theming I think is not good enough for me, since I want to be able to not only change colors and other css-styles, but also have some repeated html-code in the tempate.
Do you know about the MS way of doing it?
Jul 20, 2007 - 08:48 AM
I've implemented this approach and it works pretty well.
Two things to be aware of though.
In order to access any controls within the template area from the page directly, the ITemplate property of the UC needs this declared [TemplateInstance(TemplateInstance.Single)]
And then the controls are not accessible before the OnPreRenderComplete event, so don't do anything with them in the Page_Load method.
Thanks for pointing me in the right direction, Peter.
Two things to be aware of though.
In order to access any controls within the template area from the page directly, the ITemplate property of the UC needs this declared [TemplateInstance(TemplateInstance.Single)]
And then the controls are not accessible before the OnPreRenderComplete event, so don't do anything with them in the Page_Load method.
Thanks for pointing me in the right direction, Peter.
Dec 27, 2010 - 06:05 AM
In my opinion, the fastest way to become a computer expert is to have a powerful software in your PC, tuneup360 is such a software, have it in your computer, you can handle all the problems by yourself.
Aug 26, 2011 - 12:59 AM
No I think not you can not master pages. I do not know about others but that is what I think.
http://www.templatemagician.com/websi...
http://www.templatemagician.com/websi...
Add New Comment