Questions tagged [master-pages]

a feature of ASP.NET that allows template-based page development.

ASP.NET 2.0 introduced the concept of "master pages", which allow for template-based page development. A Web application can have one or more master pages, which, beginning with ASP.NET 2.0, can be nested. Master templates have place-holder controls, called ContentPlaceHolders to denote where the dynamic content goes, as well as HTML and JavaScript shared across child pages.

Child pages use those ContentPlaceHolder controls, which must be mapped to the place-holder of the master page that the content page is populating. The rest of the page is defined by the shared parts of the master page, much like a mail merge in a word processor. All markup and server controls in the content page must be placed within the ContentPlaceHolder control.

When a request is made for a content page, ASP.NET merges the output of the content page with the output of the master page, and sends the output to the user.

The master page remains fully accessible to the content page. This means that the content page may still manipulate headers, change title, configure caching etc. If the master page exposes public properties or methods (e.g. for setting copyright notices) the content page can use these as well.

2947 questions
0
votes
3 answers

Content page class method calling from master page class

I have a public method in my content page class, I want to call this method from master page class.
Muhammad Akhtar
  • 51,913
  • 37
  • 138
  • 191
0
votes
1 answer

ContentPlaceHolder in UpdatePanel

I have very simple a ajax enabled asp .net website with masterpage. I have a menu in master page and the other pages appear in MainContent placeholder. I have the following code.But when I click to the menu items i can see that sometimes page…
Ozgur Dogus
  • 911
  • 3
  • 14
  • 38
0
votes
1 answer

The Controls collection cannot be modified because the control contains code blocks (i.e. <% … %>)

Q: I want to add favicon.ico to my web application .so i add the icon to my solution then, i write the following: Login page : "/> every thing is okay. Master page of the other…
Anyname Donotcare
  • 11,113
  • 66
  • 219
  • 392
0
votes
2 answers

Google Docs Viewer gives javascript error inside ASP.Net page

I'm trying to embed google docs viewer in my page. Here's the test.aspx code: <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="test.aspx.cs" Inherits="Web_Application.test" %>
Aaron Azhari
  • 987
  • 1
  • 10
  • 24
0
votes
4 answers

Calling a function on another page

Can i call a function from my master page to my default page? I need to reload the content on my default page when a button is clicked on my master page. Im using session variables. but the page loads before the variables are set. Its causing an…
CsharpBeginner
  • 1,753
  • 8
  • 38
  • 68
0
votes
2 answers

viewstate with master and content page

I want to disable viewstate for my entire site, but on some pages I want to enable it. in my masterpage "main.master" I have EnableViewState="false" in my contentpage, which has main.master as its masterpage I have EnableViewState="true" This doesnt…
Adam
  • 6,041
  • 36
  • 120
  • 208
0
votes
1 answer

How to use [HandleError] without Master Page

I am trying to use [HandleError] in MVC to redirect any un-handled exceptions to the "Error.aspx" page in the "Shared" folder. By default the Visual Studio 2010 MVC2 template creates a simple MVC application with this function. It works fine. But…
Song Li
  • 141
  • 2
  • 8
0
votes
1 answer

Image Buttons of Master Pages

I use master-pages everywhere. They contain my menu with ImageButtons. They display fine, but on one page, the events are not firing, except for the help-button, which works. The page that doesn't work contains UpdatePanels. ScriptManager on that…
JayOnDotNet
  • 398
  • 1
  • 5
  • 17
0
votes
1 answer

Access user control inside asp.net Master Page from child page

I'm using Asp.net with Vb and I Have user control and I put it inside My master page I need to access this UC Properties and methods from child Page. Any help please,
Amr Elnashar
  • 1,739
  • 12
  • 33
  • 53
0
votes
1 answer

How to access Html Links which are in Master Page in View in asp.net mvc

I have three links inside master page up on clicking those three links user will be navigated to respective views. The point is I need to high light the link from which he came to the view.
Pavan Josyula
  • 1,355
  • 3
  • 13
  • 25
0
votes
1 answer

MasterPageFile reference path is incorrect on server, fine on localhost

I am trying to deploy my application to our webserver, but all of my paths are incorrect. I am getting an error that says file '/lsonet/RedSideMenu.master' does not exist. This is in the default.aspx page. On the default.aspx page, I have <%@ Page…
shawleigh17
  • 1,147
  • 4
  • 22
  • 42
0
votes
0 answers

Changing the Color of SiteMapNode dynamically

I want to change the color of SiteMapNode dynamically at runtime. I am going to change it from the master page. Some part of code goes like this : C1.Web.Command.C1WebMenuItem item = new C1.Web.Command.C1WebMenuItem(); …
Bebu
  • 65
  • 3
  • 14
0
votes
1 answer

Displaying user uploaded image in Umbraco master page

I'm using Umbraco 4.7.1 and have created a custom DocumentType called "Partner". I want to use that custom DocumentType in a masterpage. I'll show the code. public class Partner : IdentifyingMarkRemoved.DocumentTypes.Page { …
awrowe
  • 3
  • 2
0
votes
1 answer

fieldset not work in page that in MasterPage

is Fieldset not Work in default.aspx that use MasterPage ?
Livraison qsdf
it not show the border.
user609511
  • 4,091
  • 12
  • 54
  • 86
0
votes
2 answers

asp.net add background image to a few pages using single masterpage

I am trying to add background images to only a few pages where as the other pages will not have one. Do I need a separate masterpage for the pages with background images or can I do this by overriding the existing styles? My last attempt has a…
kmm
  • 57
  • 1
  • 2
  • 9
1 2 3
99
100