CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums

MS SQL 2008 on ASP.NET Hosting



Zone: > NEWSGROUP > Asp.Net Forum > general_asp.net.master_pages_themes_and_navigation_controls Tags:
Item Type: NewsGroup Date Entered: 3/24/2008 10:31:04 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 2 Views: 22 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
3 Items, 1 Pages 1 |< << Go >> >|
mayankajax
Asp.Net User
problem in applying CSS across master pages and child pages3/24/2008 10:31:04 PM

0/0

Hello frenz , 

i have designed a template which i will be using in all the pages of my site... out of that template header, footer, background will be the same for all the pages..

only the content part will differ in all the pages... 

now i want to keep one such template as the master page, and other child pages will b there...

 

below is sample markup that i am using ..

 

<body>

<div id='page_wrapper'>

<div id='page_header'>
 <h1>  XXXXXXXXXXXXXXXXXX  </h1>
<h2> YYYYYYYYYYYYY </h2>
</div>

<div id='menu_bar'>

<div id="navcontainer">
<ul id="navlist">
<li id="active"><a href="http://forums.asp.net/AddPost.aspx?ForumID=139#" id="current">Administrators</a></li>
<li><a href="http://forums.asp.net/AddPost.aspx?ForumID=139#">Recruiters</a></li>
<li><a href="http://forums.asp.net/AddPost.aspx?ForumID=139#">Students</a></li>
<!--
<li><a href="http://forums.asp.net/AddPost.aspx?ForumID=139#">Item four</a></li>
<li><a href="http://forums.asp.net/AddPost.aspx?ForumID=139#">Item five</a></li>
-->
</ul>
</div>

</div>

<div id='content_wrapper'>

<div class='spacer'></div>            <!-- TO CLEAR THE FLOAT VALUES -->

<div id='left_side'>

<h3>Left Side</h3>


<h3>Third Paragraph</h3>
<p>
Eu iudico virtute per, eu facilis imperdiet pro. Et inani aeterno sed. Ius
tempor eripuit voluptatibus ex. Eu vim virtute consequat, iuvaret aliquyam
voluptaria ea per. No vide eloquentiam quo, eos soleat nusquam te. Mazim homero
cotidieque ei eum, vim alia autem et.
Id principes constituam sed, eruditi disputationi at est. Mea audiam
efficiantur no, aperiam viderer an vel, per alia volutpat cu. Ad usu ridens
possim invenire, fastidii oporteat ei usu. Ne nisl inermis dissentiet nam. Eu
per munere altera oporteat, at aperiri luptatum evertitur usu. Est quaeque
delectus id, est quas eruditi comprehensam id.


</p>

</div>


<div class='spacer'></div>   <!-- TO CLEAR THE FLOAT VALUES -->

</div>

<div id='page_footer'>
<p>

FOOTER FOOTER FOOTER FOOTER FOOTER FOOTER FOOTER FOOTER FOOTER
</p>

</div>

</div>

</body>

 

 

out of the above code i am just going to change the contents of div with id 'left_side', rest all will b same in all the pages.. now in what way should i design

my master page so that, i can just put contents in that particular division in my child pages... pls give me sample code for the same.. I SHALL BE VERY THANKFUL FOR IT ...

MaK ...
 

XPSCodes
Asp.Net User
Re: problem in applying CSS across master pages and child pages3/25/2008 12:49:49 AM

0/0

 I guess you can create a master page with same html and just replace the div with a contentplaceholder. For all child pages, use this newly created master page.


The earth is all we have. If possible, please spare 4 minutes to watch this video
http://www.youtube.com/watch?v=47EBLD-ISyc
Amanda Wang - M
Asp.Net User
Re: problem in applying CSS across master pages and child pages3/28/2008 2:36:51 AM

0/0

Hi,

mayankajax:

now in what way should i design my master page so that, i can just put contents in that particular division in my child pages...

I would suggest that you can create more than one themes, then use different themes for different pages.

You can make all the themes have the same style of the parts except the contents of div with id 'left_side',  so which can make contents particular division in all the content pages.

Or , if you want to  change the contents of div with id 'left_side, rest all will b same in all the pages. you can set the div 'left_side's runat is server, than you can change the div's style in the page's codebehind:

For example:

 <div id="divcontent" style="width: 304px; height: 100px" runat=server ></div>

1, then export the div as a property in the master page's codebehind:

 public HtmlControl div
    {
        get
        {
            return this.divcontent;
        }
    }

2. the master type in the content page:
<%@ Page Language="C#" MasterPageFile="~/Masterpage/Case1/MasterPage.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Masterpage_Case1_Default" Title="Untitled Page" %>
<%@ MasterType VirtualPath="~/Masterpage/Case1/MasterPage.master" %>

3. change the div's stype in the content page's codebehind:
        this.Master.div.Attributes.Add("background-color", "#FFFF00");

Hope it helps.


Please remember to mark the replies as answers if they help and unmark them if they provide no help.


Yours sincerely,
Amanda Wang
Microsoft Online Community Support
3 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Making Use of JavaScript Authors: Shweta Bhasin, Pages: 448, Published: 2002

Web:
Great New Advanced Article on ASP.NET 2.0 Master Pages - ScottGu's ... That allows your CSS styles to be re-used across pages/elements more easily. ..... I never used to have this problem before master pages - is this because ...
Powell's Books - Professional ASP.NET 2.0 Design: CSS, Themes, and ... NET 2.0 Themes as well as their relationship to master pages and CSS in web ... skin files, and applying themes A mobile theme example Basic PhotoShop ...
ASP.Net 2.0 - Master Pages: Tips, Tricks, and Traps Apr 11, 2006 ... This article will highlight the common problems developers face with master pages, and provide tips and tricks to use master pages to their ...
Bookpool: Professional ASP.NET 2.0 Design: CSS, Themes, and Master ... NET 2.0 Website Programming: Problem - Design - Solution; ... CSS classes, elements, and Visual Studio CSS tools • Master pages, child pages, ...
Page Properties in master pages Now, does the child page of the master have a content control that .... We believe the same logic should apply to CSS floats: using floats ...
Amazon.com: Professional ASP.NET 2.0 Design: CSS, Themes, and ... Applying themes to your projects through various approaches, including base .... The pages on passing information from master to child is also very useful. ...
VB.NET: Regarding Master Pages, button id, page nbsp Apr 24, 2008 ... Subject: Regarding Master Pages Question stiil problem is not solved .... widths of elements and then start applying CSS on each element. ...
RE: Sharing Master Pages Across IIS Applications NET V2 and Master Pages I ran into the problem of sharing the master page located at the root of the site across all of the child department sites. ...
[D-Link] Professional ASP.NET 2.0 Design: CSS, Themes, and Master ... CSS classes, elements, and Visual Studio CSS tools * Master pages, child pages, ... Theme files, skin files, and applying themes * A mobile theme example ...
ASP.NET Master Pages Tips and Tricks You've also seen one potential technique for sharing master pages across IIS ... That can obviously cause problems if you want to use CSS and JavaScript ...




Search This Site:










customizing the site navigation

cache master page

printer friendly page using a querystring in masterpage and pagelayouts

expanding menuitem with onmouseover

web.config global page values

error when using a user control within a content section tag

mailto: in a web.sitemap

login view problem

menus submenus

tree view behaviour

master pages and seo optimization

tree view database control - trying to select gridview primary key to return to tree view

print content section

block page by direct url

how do i style treeview control?

is it possible synchronize a treeview control after treeview data has been updated... without refreshing the page?

how to put the 'cascading' back into 'cascading style sheets'?

using frames and the menu control; any ideas?

setting a colour and a font for all text on a website

setting the master page static

looking for menu control style examples

alligning a grid view in master page

multiple sitemaps using the sqlsitemapprovider for different sections

how to tell when a particular page is loading?

using response.redirect causing error

expand a tree view parent node when node text is selected

web.sitemap + navigation control

multiple inheritence??

treeview with dropdown nodes

masterpages and modal dialog boxes.

  Privacy | Contact Us
All Times Are GMT