473,387 Members | 1,535 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

how to call css file at master page

2
hi , i have made css file and want to call at master page. can any one tell me th procedure for this..

thanks
younas
Dec 1 '12 #1
4 4270
You use the <link> tag:
Expand|Select|Wrap|Line Numbers
  1. <link href="CSS/MyWebpage_CSS.css" rel="stylesheet">
Also:

Expand|Select|Wrap|Line Numbers
  1.     <head>
  2.  
  3.         <title> Pixelated Dreams </title>
  4.         <link href="CSS/MyWebpage_CSS.css" rel="stylesheet">
  5.  
  6.         <!--Adobe Edge Runtime-->
  7.         <script type="text/javascript" charset="utf-8" src="MyFirstEdgeProject_edgePreload.js"></script>
  8.         <style>
  9.             .edgeLoad-EDGE-200630931 { visibility:hidden; }
  10.         </style>
  11.         <!--Adobe Edge Runtime End-->
  12.  
  13.  
  14.  
  15.     </head>
  16.  
Dec 1 '12 #2
You CSS file will need to be in same directory as your index ("master")page, otherwise you need to list the file path...as usual with all linked-in files.
Dec 1 '12 #3
younas
2
thanks for ur reply. i use these line of code at my master page. which is including <link> tag.but still my css page not call at master page. following code is correct? if not kindly make me correct.


Expand|Select|Wrap|Line Numbers
  1. <html xmlns="http://www.w3.org/1999/xhtml" >
  2. <head runat="server">
  3.     <title>Untitled Page</title>
  4.     <link href ="CSS/WebStyleSheet.css"  rel="stylesheet"/>
  5. <style type="text/css" media="all">
  6.  
  7. </style>
  8. </head>
  9. <body>
  10.     <form id="form1" runat="server">
  11.     <div>
  12.         <asp:contentplaceholder id="ContentPlaceHolder1" runat="server">
  13.            </asp:contentplaceholder>
  14.     </div>
  15.     </form>
  16.  </body>
thanks
younas
Dec 2 '12 #4
Sorry bud...I shoulda clarified....you need to replace the following,
"CSS/WebStyleSheet.css".

Change this to match the relative path of where your file is stored. The beginning of my path starts off as "CSS" because that is a folder holding my CSS file, which is contained in the same parent folder as my index page (or "master" page). The second part, "WebStyleSheet.css", is the actual name of my CSS file. Yours will be whatever name you saved it as, and be stored in whatever folder you placed it in, so that's why it did not work.

Create a css file, or go to wherever you saved the one your trying to work with. Drag that file into the exact same folder as your index/master page. Then type:
Expand|Select|Wrap|Line Numbers
  1. <link href ="NAME_OF_CSS_HERE.css"  rel="stylesheet"/>
Dec 2 '12 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Bob | last post by:
In ASP.NET 1.1, I have a base page for all my pages in an application. The base page contains some common properties that every page needs, the code behind file of every page looks like this: ...
1
by: Alan Samet | last post by:
I know what's causing this, but how do I work around it? ********************** file: test.master: ********************** <%@ Master %> <script runat=server> void Page_Load(object sender,...
0
by: Managed Code | last post by:
Hello All, Here is my issue and thanks in advance for any assistance. I have a base page with a dropdownlist that fires an event with the selected index. The content page catches the event and...
2
by: Darren.Ratcliffe | last post by:
Hi If I have functionX in my master page, how would I call the function from my .aspx page that has the master page assigned to it? Many thanks Darren
13
by: Kirk | last post by:
I have been reading Scott Allen's article on Master Pages (http:// odetocode.com/Articles/450.aspx) but I am having problems understanding a concept. Specifically, I have created a property...
2
by: Jeff | last post by:
....if this isn't the best newsgroup for this question, perhaps someone can point me to the best one. If I'm using vb.net with visual studio 2005 .. and I want to create a button on a master...
0
by: robgallen | last post by:
I have 2 user controls within a master page, and I would like one of them to call a function in the other. All the examples I have seen involve a page communicating with the Master page, or with...
3
by: Francois | last post by:
I plan a master page / content page design for next application. The master page would contain some standard button for my app. For instance a "Save" button. (present on all pages). But how...
6
by: =?Utf-8?B?SmF5IFBvbmR5?= | last post by:
I am trying to access a Public property on a Master Page from a Base Page. On the content pages I have the MasterType Directive set up as follows: <%@ MasterType virtualpath="~/Master.master" %>...
5
by: =?Utf-8?B?bXVzb3NkZXY=?= | last post by:
Hi guys I'm trying to make my code as streamlined as possible, and add CSS file references dynamically when they are required, for example, if a page contains a webcontrol, then the related CSS...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.