.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Change Site.Master width in CSS

Posted By:      Posted Date: September 30, 2010    Points: 0   Category :ASP.Net

Hi, I'm all new to ASP.NET but not to CSS/HTML.

I created a new WebApplication in Visual Studio 2010. In the CSS document (Site.css) it says:

    width: 960px;
    background-color: #fff;
    margin: 20px auto 0px auto;
    border: 1px solid #496077;

And the first div tag in the Site.Master file is:

<div class="page">

If I change that 960px to 400px for instance, it does not change the width of my document. Even if I write 0px it does not "recognize" the change.


View Complete Post

More Related Resource Links

Using HttpModule to change master page dynamically on SharePoint 2010 site


I am trying to change master page dynamically on SharePoint 2010 site. I reviewed some documents (SharePoint: Dynamically Change Master Page: http://ranaictiu-technicalblog.blogspot.com/2009/10/sharepoint-dynamically-change-master.html) and I implemented IHttpModule, added it to GAC, modified web.config(safecontrol, httpmodule, module)
It works good! But I found some problems
1.Never catch the PreInit event for publishing pages
2."/_Layouts/RedirectPage.aspx" page occurred error
3.ContextMenu did not work

using System;
using System.Collections.Generic;
using System.Text;
using System.Web;
using System.Web.UI;
using Microsoft.SharePoint;
using System.Configuration;
using Microsoft.SharePoint.ApplicationRuntime;

namespace MasterUtilModule
    public class MasterModule : IHttpModule
        public void Dispose() { }
        public void Init(HttpApplication context){

change sharepoint site defult master page


Hi all,

i was trying to change default master to some other master page

here is wht i did.

opened site in moss designer

navigated to masterpage folder

and created a copy of default renamed it and made some changes

and then right click tht copy and set as default master

now when

i open site it says resource cannot be found whts wrong??

Master Pages: Master Your Site Design with Visual Inheritance and Page Templates


Master pages in ASP.NET 2.0 solve a problem many Web developers have been solving on their own with a variety of techniques for years - providing a single master template for an entire site. This article covers the details of master pages, discussing their usage and implementation and how they are a natural evolution of custom techniques developers are using today.

Fritz Onion

MSDN Magazine June 2004

how to change default menu tab in master pages?



i have 5 tabs in my master page application. how can i make 2nd tab as default?

any ideas?


Why do the aks master pages not get applied if the feature is not activated on the top site collecti


I installed AKS 2.0 and activated AKS feature. The problem I found was the aks master pages do not get applied if the feature is not activated on the top site collection. why is so?

example: If i activate the feature on http://<servername>/sites/<sitename> and apply the master page, I dont see any changes.

              But if i activate the same aks feature on http://<servername/ then everything started working on all sites.

              The reason i found is the CSS reference in the aks master pages.

              It reference should be given as follows:

                 for http://<servername>/sites/<sitename> ->  <link rel="stylesheet" type="text/css" href="../../Style%20Library/AKS/Aks_Band_Blueband.css"/>

                 for http://<servername>/ -><link rel="stylesheet" type="text/css" href="/Style%20Library/AKS/Aks_Band_Blueband.css"/>

So my question is, am i missing anything? am i supposed to activate the AKS feature on top level site collection at any cost? if yes, why is so? 

And after applying aks master pages, i see differnece in font sizes. Why the font size is getting changed?


Apply custom.master to "Site Settings" page?


I'm using a custom.master page, which is applied to almost all pages available to READ users.

However, I'd like to apply it to the Search, Site Settings, and View All Site Content pages.

I'm not sure where this would be applied.

Guidance much appreciated. Thanks!

Sharepoint 2007 - Wiki site - New Pages Not Inheriting Custom Master Page


I am working on a SP site (MOSS not WSS) which is heavily customised away from the OOTB layout. I need to create a Wiki site, which was going well - I've created a master page which displays the miniconsole (this was not visible with our customised layout), and made it the default master page for the site. This has been applied to the two standard pages that come with the Wiki site, however when a new page is created, it seems to inherit the default.master, rather than my custom master page - thus not showing the miniconsole.

When I have created a new page, I am able to use SharePoint Designer to attach my custom master page to it, which works perfectly, however this will not be a viable option going forward as end-users create their new wiki pages.

How can I get the new pages to inherit my master page when they are created?


Programmatically Hide Master Pages from Site Master Page Settings page?



I know there is a field you can check when you edit the properties of a Master Page in the Master Page Gallery to set a Master Page to hidden but ... can anyone think of a way to programmatically hide specific Master Pages from the Site Master Page Settings page?

Maybe this should be two questions:

  1. How do I programmatically access a Master Page in a Master Page Gallery?
  2. Is there a property that can be set that will hide the page from the Site Master Page Settings page?

Change label text on master page from the content page.

Hello. Can I access the objects (for example change the label text) on the master page, from its contents page code? If yes, how can I approach that? Thank you Artashes

The site master page setting currently applied to this site is invalid. Please select a new master p

I have defined a new master page and set it as default for the main site.  Any time I create a new subsite it does not apply the new master page and defaults back to the default.master.  The Site Master Page Settings shows this error. The site master page setting currently applied to this site is invalid. Please select a new master page and apply it The system master page setting currently applied to this site is invalid. Please select a new master page and apply it. Now if I select "Inherit site master page from parent of this site" and "Inherit system master page" and click ok the site will use the new master page and everything is fine.  There is only one modification to the master page that was done so I know the master page isn't invalid.  Does anyone know the answer other than recreating the new master page.

Unable to create columns in document library after applying custom master page to site

Hi, I have applied a custom master page to a site.There is a document library in it. I am unable to add columns in it or change the default view.Nothing happens when I click on OK butoon after making my changes. However the columns are created/default view is changed when I apply the default master page. Guess I am missing some TagPrefix or sharepoint control on master page.I had solved this problem earlier in this way but don't remeber it now. Can anyone help?

RenderAction failing in site.master, but works in a view

Hi, I have a master page into which I'm inserting a 'Search' partial view, which I've called 'pSearch.ascx'. I need to pass in a model to make some data available to pSearch, so I am using RenderAction from the site.master page, which then should call a [ClientActionOnly] Action on the 'Home' controller, called SearchPartial(), which in turn returns the pSearch view.Code from site.master:    <% Html.RenderAction("SearchPartial", "Home"); %>Code from HomeController.cs: (the method is virtual because I'm using T4MVC in the project)        [ChildActionOnly]        public virtual ActionResult SearchPartial()        {            return View(MVC.Curious.Views.pSearch);        }This is the error: "No route in the route table matches the supplied values."However, when I remove this line from site.master & insert the IDENTICAL RenderAction() call into one of my view pages, it works fine.I've been pulling my hair out, trying permutations of how it's called and different approaches, but can't work this one out, particularly because it works in a view page based on site.master, but not in site.master itself.Can anyone suggest why it wouldn't

Alternate languages - change on exisitng site

Hello. I need a help. When i choose in Site Actions -> Alternate languages and then on System account choose "Select Display Language". Work for RIBBON row and for all fields. But not work for a Quick Launch Menu. I have a .resx for Slovenian and English. I think i need some web update event receiver, but i do not find. If i use a template of SharePoint 2010 it's work also  Quick Launch Menu.

Internet facing SharePoint site - user shouldn't have to log in to change the langague

Hello, I am using SharePoint 2010 for Internet sites.  Anonymous access has been enabled.  Language packs have been installed so that users can switch to different languages as required.  However, the only way for a different language to be selected other than the default is for the user to log into the site and then the option would be displayed.....This is an internet facing site with anonymous access therefore users shouldn't have to log in to change the language.  Can someone guide/advise on switching the lanuguage of the site without loggin in. Thanks, Shelley

How to change the size (width) of scorecard columns in Dashboard Designer?

Is there any way to change the size (width) of scorecard columns in Dashboard Designer?

How to change WSS 3.0 Home site language?

Hi there, I have WSS 3.0 + internal database + Latvian language instaled, but home site is still in English, how to change home site language ?

WSS 3.0 - Master Pages - Changes not effective across site

Hi, I am relatively new to sharepoint and I have inherited a new intranet which I want to develop further. The first thing I notice is that some of the sites (i.e. the IT page) uses one master page (last updated in August) and the other pages use a master default which is different (last updated in December 2009). I want to be able to copy the August version and make it effective across all sites. I am not sure how to achieve this. I have tried making changes to the December 2009 file to see the changes take effect (i.e. change a background from red to blue) and it did not take effect across the site. This is probably basic stuff and I have purchased the Microsoft books to help, but I am at a bit of a loss on this one. Can anyone give me some simple directions on how I can make all the sites within our intranet refer to the same master default page? Thanks in advance
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend