Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 4.5.1 > BOOK: Beginning ASP.NET 4.5.1 : in C# and VB
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Beginning ASP.NET 4.5.1 : in C# and VB
This is the forum to discuss the Wrox book Beginning ASP.NET 4.5.1: in C# and VB by Imar Spaanjaars; ISBN: 978-1-118-84677-3
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 4.5.1 : in C# and VB section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old August 25th, 2015, 05:43 PM
Registered User
Points: 18, Level: 1
Points: 18, Level: 1 Points: 18, Level: 1 Points: 18, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2015
Posts: 5
Thanks: 1
Thanked 0 Times in 0 Posts
Cool IE does not load the css on the remote server

I move my application to the production server, everything works fine with other browsers except with Internet explorer, the App_theme are not loaded.

If I run my application on my local computer everything works fine with IE

If I run the application using the IE on the production server, everything works fine

but

I run the application from the client computers, the IE loads OK the pages that are on the root directory but does not load right the pages that are on subdirectories on the root, load the pages but does not load the .css theme.
Other browser works fine

page on the root directory
<link href="App_Themes/Monochrome/Monochrome.css" type="text/css" rel="stylesheet" /><style type="text/css">

page on a subdirectory
<link href="../../../App_Themes/Monochrome/Monochrome.css" type="text/css" rel="stylesheet" /><style type="text/css">
Reply With Quote
  #2 (permalink)  
Old August 27th, 2015, 05:46 AM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Hi there,

Could it be a cache issue? Have you tried clearing your cache?

Is there a live URL I can look at?

Also, try fixing this:

<style type="text/css">

I don't think that should be there. It's probably in your master page.

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
Reply With Quote
  #3 (permalink)  
Old August 27th, 2015, 02:23 PM
Registered User
Points: 18, Level: 1
Points: 18, Level: 1 Points: 18, Level: 1 Points: 18, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2015
Posts: 5
Thanks: 1
Thanked 0 Times in 0 Posts
Default IE does not load the css on the remote server

I have some pages under the root directory, these pages works fine:
Default.aspx
Login.aspx
MyProfile.aspx

I have the rest of my pages on a dif. subdirectories under the root:
/Application/Engineering/page1.aspx
/Application/Engineering/page2.aspx
/Application/General/page3.aspx
etc...
These pages does not work on IE:
switching from one theme to other theme works fine and all the pages on IE

Only:
If I load the page from my computer connecting to the production server:
The pages that are on the root directory, the IE can resolve the header css

header
{

background-color: red;
background-image: url('./Images/iconnectpeople.png');
width: 944px;
height: 86px;
}

but I have other pages on other directories and the IE cannot solve the Header css on a remote way.

IT works fine on my local Computer and also if I run the IE on the Remote server, all the pages can resolve the css.



I tried:

header
{
background-color: red;
width: 944px;
height: 86px;
}

to remove the possibility that the IE cannot resolve the url
background-image: url('./Images/iconnectpeople.png');

same results, the pages on the root directory works fine and the pages on a sub directories under the root does not work.

same thing happen with the nav section

nav
{

background-image: url('./Images/MenuBackground.jpg');
width: 827px;
height: 36px;
padding-top: 7px;
padding-left: 17px;
}

everything works fine, like #PageWrapper,
I can change values and I can see the response and all the pages

#PageWrapper
{

width: 944px;
background-color: #5487c0;
margin: auto;
}
Reply With Quote
  #4 (permalink)  
Old August 27th, 2015, 05:12 PM
Registered User
Points: 18, Level: 1
Points: 18, Level: 1 Points: 18, Level: 1 Points: 18, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2015
Posts: 5
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Imar



these 3 pages does not works on IE browsing on my computer to a remote server:
(note that the 3 pages are not on the root same as all the other pages that are not on the root and does not work)

<siteMapNode url="~/About/Default" title="About" description="About this Site">
<siteMapNode url="~/About/Contact" title="Contact Us" description="Contact Us" />
<siteMapNode url="~/About/AboutUs" title="About Us" description="About Us" />



this page works on IE browsing on my computer to a remote server:
(note that the page is on the root same as other pages on the root and works)

<siteMapNode url="~/MyProfile" title="My Profile" description="My Profile" />
</siteMapNode>


All the 4 pages uses the same
a)base page(BasePage.cs), master page(FrontEnd.master) and the same App_theme (Monochrome.css)


public partial class _MyProfile : BasePage
public partial class About_AboutUs : BasePage ans the same App_theme

<%@ Page Title="My Profile." Language="C#" MasterPageFile="~/MasterPages/FrontEnd.master" AutoEventWireup="true" CodeFile="MyProfile.aspx.cs" Inherits="_MyProfile" %>

<%@ Page Title="About Us" Language="C#" MasterPageFile="~/MasterPages/FrontEnd.master" AutoEventWireup="true" CodeFile="AboutUs.aspx.cs" Inherits="About_AboutUs" %>

remember:

everything works on IE if
a) I run local
b) if I run on the production Server IE

Not works on IE if
a) I run from a client computer to the production server
Reply With Quote
  #5 (permalink)  
Old August 27th, 2015, 07:54 PM
Registered User
Points: 18, Level: 1
Points: 18, Level: 1 Points: 18, Level: 1 Points: 18, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2015
Posts: 5
Thanks: 1
Thanked 0 Times in 0 Posts
Default

The following code is on the Monochome.css file

this code works

*
{
/*
Defines the main font used throughout the entire site.
*/
font-family: Arial, Sans-Serif;
}

body
{
/*
Clears white space around the body and gives it a grey background color.
*/
margin: 0;
background-color: #cccccc;
}

a
{
/*
Clears the underline on normal links, and gives them a different text color.
*/
text-decoration: none;
color: blue;
}
a:hover
{
/*
Underlines links when the user hovers the mouse over them.
*/
text-decoration: underline;
}

h1
{
/*
Makes h1 elements smaller than their browser default.
*/
font-size: 20px;
}

h2
{
/*
Gives h2 elements a different color and size,
and adds a bit of margin at the top to create room between the heading and the preceding element.
*/
font-size: 14px;
color: #7773A1;
margin-top: 10px;
}

#PageWrapper
{
/*
Sets the total width for the entire page. Also sets the background color
which is used to fill the background of the Sidebar in case the MainContent section is taller than the Sidebar.
Uses margin: auto to center the entire page in the middle of the browser's window.
*/
width: 944px;
background-color: #5487c0;
margin: auto;
}
.MainMenu
{
/*
The Menu gets a white border on all four sides.
*/
border: 1px solid #999999;
width: 814px;
height: 19px;
background-color: #555555;
}

.MainMenu ul li
{
/*
Gives the five menu items in the main menu a width of 100px each.
*/
width: 100px;
}

This code does not work


header
{
/*
Gives the header the same width as the PageWrapper. The height creates some room for the logo
that is set with the background-image.
*/
background-color: red;
background-image: url('./Images/iconnectpeople.png');
width: 944px;
height: 86px;
}

header a
{
/*
The header a is a link nested in header. It provides a link back to the homepage.
The size of the link is the same as the header, so the entire header is clickable.
*/
width: 100%;

height: 86px;
display: block;
}

nav
{
/*
The menu spans the page width, right below the header.
At the top and left a few pixels padding is applied to create some room.
*/

background-image: url('./Images/MenuBackground.jpg');
width: 827px;
height: 36px;
padding-top: 7px;
padding-left: 17px;
}

nav a
{
/*
Links in the Menu are white. This gets overriden by styles in chapter 7.
*/
color: #fff;
}


aside#Sidebar
{
/*
The Sidebar is positioned to the right of the MainContent section. It gets the same font-size as the
#MainContent section and gets a background image called Sidebar.jpg.
To ensure the image is visible in (most) browsers on a small page, the element gets a minimum
height of 500px. This is ignored by IE 6.
*/
font-size: 0.8em;
color: White;
background-image: url(./Images/Sidebar.jpg);
background-repeat: no-repeat;
background-color: #7773A1;
width: 142px;
min-height: 500px;
padding-top: 10px;
padding-bottom: 10px;
padding-left: 20px;
float: left;
}
section#MainContent
{
/*
Defines the main content area. The #MainContent element has a minimum height of 500 pixels, but can grow if necessary.
The font-size is 80% of its parent element, which in this case comes down to 80% of the font
the user has specified as the default font in the browser.
*/
font-size: 0.8em;
width: 759px;
border-left: 1px solid white;
border-right: 2px solid white;
float: left;
background-color: #e1e1e1;
min-height: 500px;
padding: 10px;
}

footer
{
/*
The footer is positioned below all other content (yet still within PageWrapper).
clear: both is used to clear the impact of the float properties used for #MainContent and #Sidebar.
*/
width: 944px;
clear: both;
height: 37px;
background-color: #A8D5FE;
color: White;
text-align: center;
font-size: 0.7em;
font-weight: bold;
line-height: 37px;
}
Reply With Quote
  #6 (permalink)  
Old August 30th, 2015, 08:12 PM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Not sure what to recommend as I am not sure what's going on. Are your files loading correctly but the CSS doesn't get applied?

Try using tools like Fiddler or the developer tools in your browser to see the network traffic (check for 404's) and CSS errors.

Otherwise, post the live URL and I'll take a look.

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
Reply With Quote
The Following User Says Thank You to Imar For This Useful Post:
sgurrola (September 1st, 2015)
  #7 (permalink)  
Old September 1st, 2015, 06:48 PM
Registered User
Points: 18, Level: 1
Points: 18, Level: 1 Points: 18, Level: 1 Points: 18, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2015
Posts: 5
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Imar

I downloaded the Fiddler and this tools help me to solve the problem.

there was an 404 error , File not found
"/Application/General/TSEGlobals/Scripts/modernizr-2.8.3.js"

Then I changed the master page to use a relative URL to

<script src="../../../Scripts/modernizr-2.8.3.js"></script>

and this solved the problem with IE

Thanks for your help....
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Why Can't I get CSS to load ? vincej BOOK: Professional CodeIgniter ISBN: 978-0-470-28245-8 1 September 15th, 2011 10:43 PM
VB Express and SQL server on remote server questio HoosierDaddy61 Visual Basic 2005 Basics 0 February 22nd, 2006 11:27 AM
connecting web server and remote db server via asp moreyt Classic ASP Databases 0 May 31st, 2005 12:13 AM
Linking Remote Sql Server with Web server yeetesh Pro VB Databases 1 May 26th, 2005 04:13 AM



All times are GMT -4. The time now is 12:50 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.