master-pages

How do I provide easy editing of ASP .NET master pages for designers?

Scenario: I have a pretty standard master page for all my pages. It includes the usual login forms and other dynamic lists to be extracted on each page. Webdesigners can already modify the central content place holder of each page. But still, the design and layout for the master page is still in my project and any modification to the des...

Asp.net Master Page control dynamically through code behind

I am having 2 Master Pages and I want to Switch Master page depending on the site, so I want to handle switching the master in code behind. ...

Resources for taking an existing design template and putting it into a masterpage?

I am not a designer, so I took a design template from http://www.opendesigns.org/ and was successful in implementing the design in one page, but when I tried to put it into a masterpage, it came out funny looking, so I was curious if there were any resources/tutorials on taking design templates and putting them in masterpages. ...

Using JQuery in asp.net Masterpage

JQuery is not being able to identify tags when I use in the Master Page. The following code: <script type="text/javascript"> $("body").append('<div id="test"><p>Hello</p></div>'); </script> Works fine in normal pages, but when the body is in the master page and I put this same code in the Master page - nothing happens! How can I...

Custom authorization in ASP.NET with child pages

I'm doing a custom authentication method that uses a light session object to hold a user's authorization details. Now I want each page (mainly child pages of masters) to be able to tell whether a user should have access to the page. Should I create a page class and derive the child pages from that? What's the best way for the applicat...

Where should "Master Page" logic go in MVC?

I'm experimenting with MVC, and my question is - where I had Page_Load logic in Master Pages with WebForms, where should it go in MVC? Here's the business case: Different Host Headers should cause different Page Titles to be displayed on the site's (one) Master Page, therefore all pages. For example, if the host header is hello.mydomai...

Page losing title after UpdatePanel asyncpostback

I have just noticed recently that my page title will reset to the standard "Untitled Page" after I perform an asyncpostback from inside my UpdatePanel in the main page. The title will not be lost during a postback from inside the master page (such as when I click on the search box button inside the master page). I assumed that by using ...

Usercontrol access javascript from a Content's Page's Master Page

Hello all I have a problem. I have a masterpage that all of my Content pages inherit from. Within this masterpage I have a script tag pointing to the javascript file folder "~/Scripts/validation.js" On my content pages I use different usercontrols that require the use of many of the functions within the validation.js file however if I d...

How can I implement Nested Master Pages in ASP.NET MVC RC2 ?

I have a main MasterPage which has a single column layout for the web application I am currently designing. I want to re-use the existing MasterPage to implement a two column layout using Nested MasterPages which was possible on previous releases of the ASP.NET MVC Framework but I can't seem to get it to work in the RC2. Any suggestion...

MVC, Get MasterPage path from inside a view

How can i get the path of the MasterPage from inside a view, I tought that ((WebFormView)Html.ViewContext.View).MasterPath would do the trick, but unfortunately, it's always empty. so how do I get it? ...

What is the most efficient way for a control to determine if it's rendering in a Web form or a master page?

I have a control that can be placed in a Web form (.aspx) or a Master Page (.master). I want it to function differently depending on which one it's in. My first thought is to climb the control tree back to the root and see if I cross over a MasterPage control. If so, then it would have to be in the Master Page. But, this seems ineffi...

Can a user control have a Master Page?

I am creating a page that has several user controls (similar to WebParts). Each widget has a common UI section and Content section. I implemented this using a ParentUserControl that has the common elements and a ChildUserControl that has the content. It works great so far. I am curious to know if I should have used a single control tha...

Freeze div at top of Masterpage

How do I freeze the top section of a MasterPage so that the menu doesn't scroll off the screen? ...

Flow of control in ASP.NET form

HI, I am trying to develop a form which has some user controls , which are basically dropdownlists which will be loaded with static list of pick-list values, and a master page. I have written code in the page behind to bind values to the non pick-list fields. I find that the flow of the control is like this at runtime :- 1) First th...

Linking Multiple asp.NET MultiViews

I am dealing with a master page split into various content placeholders as per usual. On a number of pages I use a multiview to show and hide the content based on different view modes (view / edit / add). This means one multiview per master page content placeholder... The trouble comes when I need to switch view modes, eg from 'View' to...

How to maintain state on a master page image menu when going to a different page?

I need to setup an image menu. The client wants a specific font and the tabs aren't really CSS-able. That said, I am wondering what the approach is to maintain state on selected menu items? For example: Lets say I have 5 tabs --HOME-- --YOUTH-- --ADOLESCENCE-- --ADULT-- When the user clicks on the 'YOUTH' menu item, they are ta...

Secure asp.net site that uses Master Pages with Forms Authentication

I've got a master page in a root folder of an asp.net application and content pages in subfolders. I'm using forms authentication and am not sure what to do, in web.config, for the master page. Does the forms authentication protect the child pages or the master page? How does it work? ...

passing viewdata to asp.net mvc masterpages

I'm trying to pass ViewData to my asp.net mvc masterpage for an mvc usercontrol that I keep on a masterpage. For example, I created a dropdownlist of names as an mvc usercontrol and I put that in my masterpage. The problem I am running into is passing the ViewData to the masterpage. I found this article from Microsoft which has a decen...

how to obtain the client id of a ContentPlaceHolder in an easy manner?

i need to add JavaScript calls in some controls attributes, i am using master pages but in order to obtain the contentplaceholder client id i am iterating over the forms controls. is there another way to obtain in the server side code of the content page? foreach (Control control in this.Form.Controls) { ...

Master Page compilation and Absolute URLs

UPDATED 03/04/09 In response to some comments, a sample from the master page looks like this. This is not an asp.net control, this is hard coded html <a href="http://www.MYDOMAIN.com/about_us.asp" accesskey="u"><span class="topleft"><span class="bottomleft">About us</span></span></a> This renders on the production server as <a hre...