Use 2 Different Themes Based On The Master Page?
Feb 9, 2011I have an App_Themes directory, and also Master pages for a ASP.NET website.
Can I use 2 different themes based on the master page?
I have an App_Themes directory, and also Master pages for a ASP.NET website.
Can I use 2 different themes based on the master page?
I have atleast 10 websites that have different css,html,javasacripts and webconfig. But the same code behind files.With this design everything is hard to maintain. So I decided to work on it and I started moving all the queries in the code beghind file to stored procedures. Since every website uses the same database.
What I have decided is to make use of themes and multiple master pages? IS this the best way to go about it?
Also lets say I have two templates. There is site A and site B. both using different templates. And have pages Home About Us and Contact.
Now would I be creating three different masterpages? for each template so 6 in total? ( since none of the templates are supposed to look the same)
or Should I just create two masterpages? if so how would I manage the html of the page so it looks different?
I have a master page which contains a treeview and a linkbutton. i have used 3 different stylesheets for the same page and those are listed in dropdownlist on the same master page. on dropdownlist change() event stylesheet of the master page change, i have 1 default style sheet which will come as master page loads.
now the problem is when i changed stylesheet from dropdown list, stylesheet changes the master page , but after that when if i clicked on treeview or linkbutton the stylesheet is restored to default one.
i have written following code
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
master page has runat=server on the head tag element, it is injecting a stylesheet on the page for some reason and I am not doing it explicitly.
Is it a themes setting that is adding the stylesheet? How can I disable it for this master page?
I have been working on a fun little project just to build my skills as an ASP.Net developer. I have learned quite a bit thus far, and don't normally post questions in forums. Google and the books I own generally do the trick for me. But for this question I would like some community input.
I am developing a simple blog platform in ASP.Net / C#. Eventually I hope it will basically be a clone of how Wordpress works. Again, this is mostly a learning project for myself and I realize there are many projects out there doing what I am doing in .Net.
Anyways, the question I want some input on is whether I should use themes or master pages to customize the look and feel of the site. As I understand it, a theme mostly just changes colors and such, but CAN do much more. Whereas a master page can easily change the look and feel of an entire site.
What are the pro's and con's of either route, and what would y'all recommend? I'm not really looking for code examples here, just input on what y'all would think is the best route to pursue.
to a vb code resource/tutorial that explains how you can change a theme from a dropdown list on a content page derived from a nested master page, not the main master page.
View 1 Repliesthere's a label control on the master page..if its value is "Value1" ,I want this CSS Sprite to display on my webform..if the Value is "Value2"..the CSS sprite should use some different image..just the image needs to be changed ..nothing else in that Sprite..
I found out that I can use "FindControl" method to find out what value that Label Control of Master Page's currently got..
Now how do I change that image on the banner ?? How do I go about it ? Also that CSS Sprite now is a user control named "myBanner.ascx"(earlier was an aspx file)..Now do I need to make 2 diff usercontrols or I can implement some logic in one usercontrol itself ?
Should I make 2 copies of this "myBanner.ascx" with JUST the "image name" changed in its CSS ?
What I want is ONE banner which has been made using CSS Sprite ..Now if the "Label Control's "value in the master page is "Value1" then the image to be used on that banner is "IMAGE1" else if "Label Control's" value is "Value2" then "IMAGE2" should be used in that sprite..
We have a nested master page which we have made it as a seperate class library.(Becoz many projects use the same master page) Initially we had all our css files,skin files, images inside the Master page project itself. But now we wanted the themes to be global and moved it out to wwwroot as mentioned in the below link.
http://quickstarts.asp.net/QuickStartv20/aspnet/doc/themes/themes.aspx#global
The Masterpage has user controls out of which one user control has the telerik menu. The css is not getting set for that particular user control. We use relative path for setting the style sheet link. But it is not getting set. Its still referring to the old path. But all the skin files, images are pointing to the new global location. Except for the telerik menu rest all is aligned according to the style sheet.
When i do view source, the link to style sheet is pointing to the old location. I dunno why this happening. Is this a telerik issue or i am going wrong somewhere.
My Master Page has a heading with tabs. The code looks something like:
<CT:Tab ID="tabHome" runat="server" Url="/index.aspx" Text = "Home" Highlight="true" />
<CT:Tab ID="tabFun" runat="server" Url="/fun.html" Text = "Fun"/>
<CT:Tab ID="tabBlog" runat="server" Url="/blog" Text = "Blog"/>
I can think of two ways to control which tab is highlighted from within a user control:Have the user control implement an interface. The master page can decide which tab to highlight based on which interface is implemented, or based on a method in the interface that returns a string.In the Page_Load (or Page_Init) function, tell the master page (via FindControl or via a function in the Master Page) which control to highlight.I don't really like either of these solutions. Is there a clean way I could control which tab is highlighted from the control at design time (i.e., in the aspx file)?
I'm trying to set profiles/themes using a basepage to allow the colour of my site to change for users. I can do this on a single page but I'm trying to do this site wide and am getting an error.
I've been watching http://www.asp.net/general/videos/how-do-i-create-user-selectable-themes-for-a-web-site this tutorial
but I'm getting errors at the final step...
System.NullReferenceException was unhandled by user code Message="Object reference not set to an instance of an object." Source="App_Code.gflsvdcc" StackTrace: at BasePage.OnPreInit(EventArgs e) in D:WebsitesBalticQuarter19.01.11App_CodeBasePage.vb:line
9 at System.Web.UI.Page.PerformPreInit() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) InnerException:
is the error, The error occurs because of the line 9 =
9 - Me.Theme = Request.Form(Me.Master.FindControl("DropDownList1").UniqueID)
If I insert this instead of the text above the colours change on the site.
Me.Theme = Request.Form("ctl00$DropDownList1")[code].....
Been browsing these pages for a while now and finally decided to say hi!I read about having an "Application controller" as mustinherit class for the actual controller to set content for the master page. But what I would like to do is to set some content to Master based on which actions are called on the controller.
For example..
/Backend/A1
... "Help content nr1 to master page"
/Backend/A3
/Backend/B1
... "Help content nr2 to master page"
/Backend/B10
And so forth. Ofcourse I could do this the "easy" way by just adding some clip on each of the actions. But I was wondering if there is a smarter way to do it. To check on the application controller which action is being called and select the "helpcontent" based on that to the Master.
would like to present users with unique content based on certain conditions being met as they land on the home page (default.aspx). The condition logic will be in the VB code behind Page Load event. The content will go in a content placeholder as specificed from the master page. However, the content change wouldn't be something small (ie making a panel or label visible or not) but rather it will be different HTML, Divs and databound gridview content. The HTML content will be stored in the database.
View 3 RepliesI am using a master page with a treeview control. I have 2 other pages Summary.aspx and Home.aspx
I want the Summary page to be loaded when I run the application but afterwards I want to load the Home.aspx page based on the selected Node change event of the treeview control.
I have placed the treeview control in master page because it has to remian the same for all my pages.
Did I do something wrong? The problem is I am not able to load the pages based on events occuring for Tree view control.
I'm using the Google CDN to load my JQuery file. However, I'd like to have my master page use a separate theme to my content page. Is this possible when using the CDN? I'm using ASP.NET.
View 2 RepliesI have a master page containing a tree and 3 dropdown lists. I am populating a context menu on right click of each node, and when clicked on any item of the context menu, it navigates to required pages.
My problem is after navigating to the required page, the selected values from the drop down lists and the selected node from the tree are getting cleared.
I can set the selected values for the dropdown lists by making some properties in master page.
But how do i maintain the selected node?
In my content page, i have got the valuepath of the right clicked node.
Or is there any other way than setting the properties in master page?
My Project is a normal web site, not a Web Project, and I am using VS 2005.
I am trying to define common Master Page Type in app_code which has an area to display error messages and the like. Very simple.
I added the following in app_code:
[Code]....
Also, I added the following in Master Page Source Declaration:
[Code]....
Also, I added the controls tblrowErrMsg and lblErrMsg as server controls to the Master Page.
Why I am doing this ?
This will allow me to display error messages from nearly any where inside the code in code-behined, app_code, and other core Class Projects (DLL).
I have a master page setup that is used throughout my site that is basically a header with a menu. I recently added a textbox and a button to this master page which is to be a quick search box that is available anywhere in the site. When a user enters text into the search box and hits the button, I need to load the actual content page which is used to search and show search results (which also uses this same master page), and have the text entered available so the search can be triggered automatically. Again, this search text box and button is now in my master page so it could be triggered from anywhere in the app... it serves as a convenient way to do a basic search from anywhere in my app, without having to first navigate to the actual 'search page' that already exists. You can also navigate to the actual search page, which uses the same master page, where there is many more search options.I'm thrown off by the master page arrangement, which I have not used until this project. What do I do?
View 4 RepliesIs it possible to inherit a sharepoint master page(as a parent) in another application's master page which will be treated as child (i.e. after integrating that standalone application with the sharepoint application)? I am totally new to Sharepoint..
View 2 RepliesI have a nested master page that has its own master page. The parent master page has a property defined in its code behind.
Public ReadOnly Property SelectedPage() As String
Get
Return _selectedPage
End Get
End Property
How can I reference the parent master page's property from within either the child master page's code behind Page_Load or aspx template page?
I'm trying to dynamically change the look of my main master page depending on what nested master page that the current content page is using .
So for example.
Main master page = main.master
My nested page = nested.master (uses main.master)
content page = content.aspx (uses nested.master)
So in the Page_Load event of main.master I want to add a switch statement that will check to see what nested master page is currently being used by content.aspx, or whatever content page is loaded.
So far I have got
protected void Page_Load(object sender, EventArgs e)
{
string nMaster = //This is the line of code that I am looking for.
switch(master)
{
case "nested.master":
//all my logic here.
break;
}
}
I have a 3 level nested master pages and a content page. parent1 is the top parent, parent2 is parent of parent3 and parent3 is the parent of the content page.
I get an error 'Cannot find ContentPlaceHolder xxx...' where xxx is a ContentPlaceholder. It resides in parent2 and content page is trying to fill it.
Can content pages only use their direct parent ContentPlaceHolders or can they also use any of the higher master pages?
How to access controls in master page using javascript? The master page consists of a search textbox, on key down event of the control I call a javascript function writtern inline of the master page. I get the value of entered in textbox in that javascript function. I have tried giving document.getElementById("<%=txtSearch.ClientID %>").value as well as document.getElementById("txtSearch").value. Both display error. I have to access the textbox control from within the master page itself!
View 1 RepliesI've recently noticed this in my VS. What exactly is an Ajax Master Page and how is it different than a regular master page?
View 2 RepliesI have a page inside my folder ( say Admin Folder , Page1.aspx ) and I want to use the Master Page which is placed Outside the folder.
with Intellisense I am getting like this ~/Mymaster.master", but at run time it is throwing an error.
I have a question about master page.After i pushed button i would like to change my master page to another master page for that page, is that possible?
View 4 Replies