Reputation: 11125
I am decision dilemma as to the requirement of a client
I want to change the look and Layout both of the site - XXX Client
Generally this is how it should work,
You change a theme the website is displayed with different images and Colors.
You change a masterpage your website changes it's layout (sidebar moved to right from left - provided the layout is specified in masterpage)
I am confused as to how one would accomplish this. If i design my pages using a default masterpage then when i switch to another masterpage there is no assurance that other masterpage might have same content placeholders.
This would throw an exception
How can i implement multiple masterpages Intelligently without creating 2 pages each for the respective masterpage ?
dilemma is caused by other colleague implementing his own ideas into pages developed by him, He over popups to display forms on sidebar link clicks mine directs to separate pages.
Upvotes: 1
Views: 241
Reputation: 1905
You can change dynamicly the masterpage on PreIint.
Select Case iForum
Case 6 '41
MasterPageFile = "/Children/Forum.master"
Case Else
MasterPageFile = "/Ezra/Forum.master"
End Select
(I know that I can write better example)
Now, Create a BaseMaster
class, with your variables, functions, etc, and inherit the website MasterPage from this class.
Now add to the top of page:
<%@ MasterType TypeName="ForumMaster"%>
And now just use Master.YourFunction()
. It will work with all MasterPages.
Good Luck !
Upvotes: 1
Reputation: 9061
You should be able to achieve this in CSS without changes to masterpages or themes. That way you will guarantee that the content placeholders will be unchanged.
Change your images to be set from CSS (something like):
.imageFromCss { background:url("../images/myimage.png");
}
And CSS can move sidebars from left to right:
.sidebar {display:inline; float:right;}
Upvotes: 1