master-pages

How can I change the background of a masterpage from the code behind of a content page?

I specifically want to add the style of background-color to the body tag of a master page from the code behind (C#) of a content page that uses that master page. I have different content pages that need to make the master page have different colors depending on which content page is loaded in such that the master page matches the cont...

Setting an ASP.NET Master Page at runtime

I'm working on a site which needs to be able to support two or more looks, changable at runtime. I'd hoped to be able to handle the change with a CSS switch, but it looks like I'll need to use a different masterpage for each design. So, what's the best way to set the masterpage at runtime? Page.MasterPageFile can only be set in the Page...

ASP.NET Master Pages equivalent in Java

What would be the Master Pages equivalent in the Java web development world? I've heard of Tiles, Tapestry and Velocity but don't know anything about them. Are they as easy to use as Master Pages? I want something as easy as set up one template and subsequent pages derive from the template and override content regions, similar to Ma...

What is the best way to share MasterPages across projects

Suppose you have two seperate ASP.NET Web Application projects that both need to use a common MasterPage. What's the best way to share the MasterPage across projects without having to duplicate code? Preferably without having to resort to source control or file system hacks. ...

Call onresize from ASP.NET content page

I have a JavaScript method that I need to run on one of my pages, in particular, the onresize event. However, I don't see how I can set that event from my content page. I wish I could just put it on my master page, but I don't have the need for the method to be called on all pages that use that master page. Any help would be appreci...

Why is my web control null?

I have a web site in asp.net that uses a master page. In this master page I have a multiview control with one view that has all the content for the content pages and one view that has some local content to the master page where I show error messages from all content pages. In this error view I have a asp.net Label control that displays ...

Html.RenderPartial call from masterpage

Here is a scenario: Let's say I have site with two controllers responsible for displaying different type of content - Pages and Articles. I need to embed Partial View into my masterpage that will list pages and articles filtered with some criteria, and be displayed on each page. I cannot set Model on my masterpage (am I right?). How do I...

What is the Best Way to Populate a Menu Control on a Master Page

Database? Page variables? Enum????? looking for opionions here. ...

Paths in master pages

I've started to work a bit with master pages for an ASP.net mvc site and I've come across a question. When I link in a stylesheet on the master page it seems to update the path to the sheet correctly. That is in the code I have <link href="../../Content/Site.css" rel="stylesheet" type="text/css" /> but looking at the source once the...

Force browser to use new CSS

Is there a way to check if the user has a different version of the CSS cached by their browser and if so force their browser to pull the new version? ...

Sharepoint, master pages and CSS

I am trying to develop everything in sharepoint as features so I can easily deploy to test and live sites without having to do any manual steps. I can deploy my master page okay, and though currently i have to switch it on by hand I am confident I can automate that in the future. What I am having difficulty is getting a CSS file to mat...

ASP.NET Masterpage in separate assembly

I have some ASP.NET Master pages located in one assembly. I need to use these masterpages for my webform pages located in other asseblies that have a reference to the first assembly. I cannot seem to figure out a way to do this. Is there a nice way that I can do this? If you do not have a pretty solution I would also like to hear about...

How to pass page's meta tags in ASP.NET MVC?

Hello, I'm playing with ASP.NET MVC for the last few days and was able to build a small site. Everything works great. Now, I need to pass the page's META tags (title, description, keywords, etc.) via the ViewData. (i'm using a master page). How you're dealing with this? Thank you in advance. ...

Find controls on sharepoint master page

I'm trying to loop through all the controls on a sharepoint page, for the purposes of testing i just want to output the control ID this is the code i'm using Public Shared Sub SubstituteValues3(ByVal CurrentPage As Page, ByRef s As StringBuilder) 'Page() '- MasterPage '- HtmlForm '- ContentPlaceHolder '- The TextBo...

Element-Enhancing Javascript in ASP.NET Master Pages

Hi all. I have run in to a bit of a problem and I have done a bit of digging, but struggling to come up with a conclusive answer/fix. Basically, I have some javascript (created by a 3rd party) that does some whizzbang stuff to page elements to make them look pretty. The code works great on single pages (i.e. no master), however, when I...

Form Elements in ASP.NET Master Pages and Content Pages

OK, another road bump in my current project. I have never had form elements in both my master and content pages, I tend to have all the forms in the content where relevant. In the current project however, we have a page where they want both. A login form at the top right, and a questions form in the content. Having tried to get this i...

Preferred way to include relative reference to JavaScript in VS 2008 nested Masterpage.

Our base Masterpage has something like the following <head runat="server"> <title></title> <script type="text/javascript" src="<%= Page.ResolveClientURL("~/javascript/actions.js")%>"></script> <script type="text/javascript" src="<%= Page.ResolveClientURL("~/javascript/jquery/jquery-1.2.6.min.js")%>"></script> <asp:content...

Does a MasterPage know what page is being displayed? [solved]

When I navigate on a website utilizing MasterPages, does the application know what page I am on? If so, does it store it in an object I can access? The reason I am asking is so I can replace this: //masterpage <div id="nav_main"> <ul><asp:ContentPlaceHolder ID="navigation" runat="server"> </asp:ContentPlaceH...

How to generate ASP.NET page every time when using master pages?

I'm moving an old VBScript web site over to ASP.NET, so I'm starting to use master pages instead of #includeing lots of other files with server side VBScript in them. How can I stop the pages (as in the ones that are based on master pages) from being generated once and then stored? If I make a change to the master page (or any page bas...

Got to switch HTML guys mid-stream

So, this is my first PM experience and shame on me if I'm not learning something new every day. The guy I hired to do my XHTML/CSS accepted a full time position somewhere else. Which SUCKS. I can either stay with him (he said he could get a friend to help during this transition) but he HASN'T been dependable. However, if I switch horses...