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


Top 5 Contributors of the Month
Easy Web
Imran Ghani
Post New Web Links

Using masterpages and css?

Posted By:      Posted Date: September 10, 2010    Points: 0   Category :ASP.Net
 
Hi all, I am trying to use a masterpage and apply some CSS to it but for some reason I am experiencing an issue. Maybe its my understanding of masterpages but hopefully someone can help.I have a MasterPage called Main.masterI have a WebForm called Default.aspxI want Default.aspx to use Main.master as its MasterPage, but my MasterPage uses a stylesheet which is fine as I want that applied across the entire site but I would like to extend it. For example, my Default.aspx page contains a login username and password which I have styled and imports a style called Login.css. For some reason when I view Default.aspx all the other styles that are from Main.master are gone, and only my Login.css is applied? I want my MasterPages stylesheet to always apply and then add any additional ones that want to be added. So my default.aspx page would have the styles of Main.master and any that it wants to apply...Can I do this? Thank you in advance :)


View Complete Post


More Related Resource Links

Get value of dynamic textbox in dynamic table with masterpages

  
Public Sub createtable() Dim b as Integer = 1 For i As Integer = 1 To b Dim tbl As New Table() Dim tr0 As New TableRow() Dim tr1 As New TableRow() Dim tr2 As New TableRow() Dim trh As New TableRow() Dim th As New TableCell() Dim td As New TableCell() Dim td0 As New TableCell() Dim td1 As New TableCell() Dim td2 As New TableCell() Dim td3 As New TableCell() Dim td4 As New TableCell() Dim td5 As New TableCell() Dim td6 As New TableCell() Dim td7 As New TableCell() Dim td8 As New TableCell() Dim td9 As New TableCell() Dim td10 As New TableCell() Dim td11 As New TableCell() Dim title As New DropDownList() Dim fname As New TextBox() Dim mname As New TextBox() Dim lname As New TextBox() Dim address As New TextBox() title.ID = "txtTitle" title.Items.Add("Mr.") title.Items.Add("Ms.") title.Items.Add("Mrs.") fname.ID = "txtfname" mname.ID = "txtmname" lname.ID = "txtlname" address.ID = "txtaddress" th.

Custom VewEngine and masterpages

  

Hi,

I have a custom view engine. My costome FindView method specifies the master page of all views.

public override ViewEngineResult FindView(ControllerContext controllerContext,
                    string viewName, string masterName, bool useCache)
    {
        masterName = FindMasterPageForView(viewName);

        ViewEngineResult result = base.FindView(controllerContext, viewName, masterName, useCache);

        return result;

}


The problem is that this code ignores the master page directive set in the view itself. Is there a way to find what is the value of the master page directive in the FindView method?


Adding webparts to multipages without using masterpages

  

Hi all,


Is there a way to add the same webpart to multiple pages across a site (using shared personalisation) without the use of masterpages?



Thanks in advance.


Nested Masterpages

  

Hi there,

I have a question about nesting masterpages in an asp.net webapplication.

My problem is that the application i am supposed to create has a few webpages that share 90% of the same controls, only one section in the lower half of the pages are different. I was wondering what the best practice is for building such a website. Should i make a masterpage  that contains the uppper hald of the pages (which is similar in each page), and derive from that for the specific pages?


How to use Multiple masterpages depending on the user permission

  
Hi, I am having Two master pages in sharepoint 2010 RTM enterprise

one mastepage has to be load when site admin has logged in\

other masterpage has to be load when 'other than'  site admin is logged in

For doing this req,I created feature activated event i done through this object model.


But this is working only when feature activated(1 time only).Not based on the logged in user


If i deactivate and activate again it will start working(load mastepage) one time only.
As I know, feature  will perform the action .once the site is open then it will start.

As per my requirement Before page loads my code has to work.


I also created Httpmodule,written Init method,but it also not working....Is there any other procedure i need to follow for doing this.Please help me.

How to use Multiple masterpages depending on the user permission

  
Hi, I am having Two master pages in sharepoint 2010 RTM enterprise

one mastepage has to be load when site admin has logged in\

other masterpage has to be load when 'other than'  site admin is logged in

For doing this req,I created feature activated event i done through this object model.


But this is working only when feature activated(1 time only).Not based on the logged in user


If i deactivate and activate again it will start working(load mastepage) one time only.
As I know, feature  will perform the action .once the site is open then it will start.

As per my requirement Before page loads my code has to work.


I also created Httpmodule,written Init method,but it also not working....Is there any other procedure i need to follow for doing this.Please help me.

Masterpages and Master ViewModels

  

Hello,

Im slowly migrating over from web forms and have been doing a lot of tutorials recently with MVC and have been going over the repository pattern quite a bit. Everything has been going smooth, I have created my repository, service layer, tests and all that fun stuff, created a controller called a basic GetAll() method and passed it to the view and am displaying this as a list. This also works great.

What my problem is now is that I have a master page where I want to choose somthing from a dropdownlist, which will then populate my view.

In webforms this is a very simple thing to do, but it seems populating a master page in MVC is somewhat of a tricky thing to do.


Im trying to avoid ViewData at all costs. I know want to use a Master ViewModel and a BaseController, as I started writing my master view model, I had to create an instance of my service layer in my constructor in order to populate my "Master Model".


        public MasterViewModel(IProductService service)
        {
            this._service = service;
        }

Then I thought to myself, I am probably going to need data from somthing not product related in my master page which means I would need to inject another service into my constructor.


        public Mast

Jquery and Masterpages

  


I have a masterpage with the following:

<script type="text/javascript" src='<%# ResolveUrl("~/Scripts/jquery-1.4.2.min.js") %>'></script>
<script type="text/javascript" src='<%# ResolveUrl("~/Scripts/jquery.cycle.all.min.js") %>'></script>

<script type="text/javascript" src='<%# ResolveUrl("~/Scripts/jquery-1.4.2.min.js") %>'></script>

<script type="text/javascript" src='<%# ResolveUrl("~/Scripts/jquery.cycle.all.min.js") %>'></script>

and an .aspx content page with:

<script type="text/javascript">
       $(document).Ready(function () {
           $('slideshow').cycle({
               fx: 'fade', // choose your transition type, ex: fade, scrollUp, shuffle, etc...
       &n

How to get request.form working in masterpages?

  
Hi all,

On pages that use masterpages, request.form always return null. It works fine on pages without masterpage. Is this normal? How to use request.form in pages with masterpages?


Thanks in advance.

SharePoint System Dialogs and Customized MasterPages

  
Anyone who has tried to brand and customize SharePoint know what kind of madness and headaches that go along with it. Just when you think that your masterpage looks good you click into a deep dark subpage that makes your layout look hideous. Although things were made easier in 2010, for some reason I could never get the modal dialog pages look quite right. I finally determined that I wanted to just have those look OTB. I still wanted the system pages to have the branding, i just wanted to remove...(read more)

Buying MasterPages for SharePoint 2010

  

Hello All!

More after experience than anything else... rather than creating our own Master Page we're looking at buying one, but the only site I've found so far is: http://www.masterthemes.net/default.aspx

Does anyone know of any decent MasterPages sites/stores that I could puchase for SharePoint 2010?

Kind Regards,
Dayna


Categories: 
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