master-pages

Change <body> ID with Javascript from within ContentPage

I'm looking to do a short term hack on a site. The site is a ASP.NET site with a master page. The body tag is in the master page. I'd like to specify which ID should be in the body tag from within various content pages. What I don't know is if you can have this type of access to the body tag when your JS is within the body tag. For...

Hide content in master page from view page

I have a master page which is shared between about 20 views. In just one view, I need to make one small adjustment to the master page (I need to hide a textbox). How can I include css or javascript in my view to acheive this? Or is there some clever trick like including a conditional <% if (View.Name = "blah") { ... } %> that I can sti...

Find ContentPlaceHolders in Master page

I'm looking for a way to dynamically load a master page in order to get a collection of ContentPlaceHolders within. I would prefer not to have to load a page object to assign the master page to before I can access it's controls, but if that's the only way I'll be happy to use it. This is the way I was hoping it would work: Pag...

Is it possible to have a ASP.NET MVC MasterPage that has webforms User Controls which cause PostBacks?

I'm pretty sure the answer is going to be no here, but I just want to be sure. As you can probably guess I'm in progress of converting a web forms project over to ASP.NET MVC. Thus, I have a web forms master page and a MVC master page. The user controls (.ascx) render fine in the MVC Master page, but the post-backs essentially do nothing...

How to create master template for html pages

I have some ten html pages with same header ,footer ,left and right navigation tabs can i have one master template so that i will refer header and footer and navigation tabs from each page without using any asp controls . ...

Why the CSS style is not applied in webpages within subdirectories?

In the root of my domain i have the CSS file style.css and the masterpage file site.master. The link to the CSS file within the site.master is <link href="style.css" rel="stylesheet" type="text/css" media="screen" /> The problem is that webpages contained within subdirectories do not inherit the CSS file. What am i doing wrong here?...

how can we avoid header and footer code repeating in each html pages

I have some ten html pages each page also has same header and footer tag can i have one page with complete header and footer ,and i will refer to that particular page from other html pages. ...

Is it possible to use sharepoint master page in a separate application as parent master page...

Hi, Is 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...Any links or article source related to this will be highly appreciated. Regards, DC...

Can content page use ContentPlaceHolderID of master parent of its master page (nested master pages)

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 u...

Access asp:content from code behind

Ok, I am an experienced web developer but sometimes ASP.Net is tricking me. I have a master page in asp.net. Then I have a page based on that master page (home.aspx). Now in home.aspx.cs I want to access the asp:content controls to add controls programmatically. Aspx looks like this: <asp:Content ID="leftCol" ContentPlaceHolderID="c...

Error: "The file '/MasterPages/MainMaster.master' does not exist." (Yes, this file does exist!)

Hi, I just got a new desktop computer with Windows 7 Pro as the operating system. I installed Visual Studio 2008 on to this new computer and tried to open a previously existing ASP.NET 3.5 solution that displayed perfectly fine on my previous computer (this previous computer used the Windows XP operating system, IIS6, and IE7 browser). ...

ASP.NET JavaScript from MasterPage doesn't work

Hello. I put common(for all my content pages) js to head section at my masterpage. <head runat="server"> <script type="text/javascript" src="../Scripts/jquery-1.4.1.js"></script> <script type="text/javascript" src="../Scripts/jquery.corner.js?v2.11"></script> <script type="text/javascript" src="../Scripts/jquery.timers.js"></script>...

Hide outer tables in ASP.net

One of the features of a website I'm working on is that you can "maximize" the contents of the page, basically removing all the outer elements of the page, navigation, banners, etc. This is currently done in what seems like the worst possible way: <% if (shouldBreakFrame) { %><!--#include file="header.include" --><% } %> // Contents o...

Cufon Asp.net in master page

Hi all, I try to use Cufon fonts in my web page. I have master page and in head tag I have this: <script src="js/jquery-1.4.2.js" type="text/javascript"></script> <script src="js/cufon-yui.js" type="text/javascript"></script> <script src="js/cufon-replace.js" type="text/javascript"></script> <script src="js/GeosansLight_500.font....

How can I get data from input fields that are on master page?

Hi, I'm using ASP.NET MVC 2 technology for developing my web site. I have two input fields in my master page (username and password) and one submit button. How can I get data from those input fields? Please help. ...

Stopping MVC ViewMasterPage from resolving CSS URLs

By default Master pages in .NET MVC2 placed like this /folderlevel1/folderlevel2/Site.master accessed from the url domain.com/urllevel1/urllevel2/ will resolve the URL in this tag: <link href="/Content/Site.css" rel="stylesheet" type="text/css" /> to <link href="../../Content/Site.css" rel="stylesheet" type="text/css" /> This beco...

C# ASP.NET MasterPage nested inheritance is evil

I have a solution with quite a few different MasterPages / BasePages which all inherit from somewhere else. My problem is that I have a virtual string in BaseMaster, which is overridden by BaseManagement, but when I try to access this string I always get the base value The point of inheriting masters and pages is obviously to avoid havi...

Dynamically add <asp:content to page, Nested masterpages

hi all, I am currently using nested masterpages in my latest asp.net 4.0 project and i want to change the look and feel dynamically, so the homepage may just be 1 column wide, about us page may be 2 columns etc. I am dynamically loading the masterpage dependant on the record selected in the DB (1column.master, 2column.master) on the pr...

ASP.NET MVC 2: Session or TempData in Master Page?

I have a div in my master page that is only displayed if Session["message"] contains data: <% if (!String.IsNullOrEmpty(Session["message"].ToString())) { %> <div id="sessionMessage" class="sessionMessage"><%:Session["message"].ToString()%></div> <% } %> I use it to pass general info to users for both acti...

nested master page with more than one nesting pages

I dont know if I have the right title for this question but here goes - I have this specification. i have 1 master page that has a top navigation bar linked to some aspx pages. These aspx pages have the masterpagefile as the main master page. Now i need 2 forms in the main master page that are part a and part b. So Part a = firstname, ad...