Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Images and CSS will not render
Guest
#1 Posted : Tuesday, August 1, 2006 2:01:47 PM(UTC)
Groups:
Joined: 11/1/2005(UTC)
Posts: 278

I have a ASP.NET app built with VS 2003 running with UltiDev Cassini 1.1.

On my dev box which is a Windows Advance Server 2003, I'm running IIS as the web server and my app renders all the images and displays the style sheet definitions correctly to the web page.

When I run the app on a different box (XP) with Cassini 1.1 as the web server none of my images or style sheet definitions are displayed. The images are located in the <app_root>/images directory and the css is in the <app_root>/css directory. If I right click on the image on the web page the URL displayed is http://<machineName>:<port>/images/<imagename>.gif

Why can't my images render

Ultidev Team
#2 Posted : Tuesday, August 1, 2006 2:12:52 PM(UTC)
Ultidev Team

Groups: Administration
Joined: 11/3/2005(UTC)
Posts: 2,253

Thanks: 28 times
Was thanked: 60 time(s) in 59 post(s)
Hi there!

According your your description, everything is done correctly. Since we are not aware of any issues preventing Cassini from serving images, the only way for us to help you is to get detailed information about the issue, like path to the physical folder with the application, then path to images, and then page's HTML source that does not render the images.

Regards,
UltiDev Team.
Please donate at http://www.ultidev.com/products/Donate.aspx to help us improve our products.
Guest
#3 Posted : Wednesday, August 2, 2006 8:00:10 PM(UTC)
Groups:
Joined: 11/1/2005(UTC)
Posts: 278

Hi,
Here is a follow up to the problem I've been having with the images not displaying and the style sheets not being linked.

Here is the information from the Cassini Web Server Explorer:

Port: 4146
Name: BLT Local Edition
ID: application ID
Physical Location: c:\Program Files\BLT
Default Document: Default.aspx

My application is installed in the correct directory: c:\Program Files\BLT

C:\Program Files\BLT\bin contains dll files
C:\Program Files\BLT\css contains FormStyles.css
C:\Program Files\BLT\images contains banner67.gif
C:\Program Files\BLT contains web forms (webForm.aspx)

Here is a copy of webForm.aspx

<%@ Page language="c#" Codebehind="WebForm.aspx.cs" AutoEventWireup="false" Inherits="BLT.WebForm" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>WebForm</title>
<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
<meta content="C#" name="CODE_LANGUAGE">
<meta content="JavaScript" name="vs_defaultClientScript">
<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
<LINK href="css/FormStyles.css" type="text/css" rel="stylesheet">
</HEAD>
<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">
<asp:Image id="Image1" runat="server" Width="760px" Height="67px" ImageUrl="images/banner67.gif"></asp:Image>
<asp:Label id="Label1" style="Z-INDEX: 101; LEFT: 104px; POSITION: absolute; TOP: 136px" runat="server" CssClass="datagridheader">datagridheader</asp:Label>
<asp:Label id="Label2" style="Z-INDEX: 102; LEFT: 104px; POSITION: absolute; TOP: 168px" runat="server" CssClass="subtitle">subTitle</asp:Label>
<asp:HyperLink id="HyperLink1" style="Z-INDEX: 103; LEFT: 104px; POSITION: absolute; TOP: 208px" runat="server" NavigateUrl="WebForm.aspx">WebForm</asp:HyperLink></form>
</body>
</HTML>



Excerpt from FormStyles.css

.DataGridItem {font-size: 8pt; color: #000099; font-family: verdana, arial, helvetica, geneva, sans-serif; background-color: #ffffff; border-style:none; border-collapse:collapse; }
.subtitle {font-size: 10pt; color: 000099; font-family: verdana, arial, helvetica, geneva, sans-serif; font-weight: bold; }


Thanks!
JR


Ultidev Team
#4 Posted : Thursday, August 3, 2006 5:43:26 AM(UTC)
Ultidev Team

Groups: Administration
Joined: 11/3/2005(UTC)
Posts: 2,253

Thanks: 28 times
Was thanked: 60 time(s) in 59 post(s)
Hello, JR!

You've done the URLs exactly right. The reason why it's not working is a mystery. To understand what's wrong we'll need to figure our what's going on on the wire when the page is rendered. Specifically, we'll need to see what resources the web browser is requesting and how Cassini is responding. To do that could you please try to use Fiddler - an excellent, very easy to use HTTP spying program. If you run the Fiddler and then the faulty page in the broswer, you should see multiple HTTP requests going from the browser to Cassini for images, CSS, etc. The information about requests will include among others exact requested URL and HTTP response code. This way we'll know exactly where the conversation between the browser and Cassini breaks down.

Best regards,
UltiDev Team.
Please donate at http://www.ultidev.com/products/Donate.aspx to help us improve our products.
Guest
#5 Posted : Friday, August 11, 2006 9:36:26 AM(UTC)
Groups:
Joined: 11/1/2005(UTC)
Posts: 278

Resolution:

Judging from the session files you have sent (thank you very much - it was helpful) the failure seems to occur in your application's PreRequestHandlerExecute() method in Global.asax.cs. At this point we can't tell whether the problem is caused by some difference between Cassini and IIS, or be the logic in the PreRequestHandlerExecute() method that could be doing something IIS-specific.

When looking into PreRequestHandlerExecute() method please check the logic accessing Session state and checking if the Context.Session != null before using Session object.

cunet
#6 Posted : Saturday, August 19, 2006 12:29:25 AM(UTC)
Groups: Member
Joined: 8/19/2006(UTC)
Posts: 9
Location: China

Resolution:
Add below codes into the <configuration> of your web.config:

<location path="path to images, css or script location">
<system.web>
<authorization>
<allow users="?" />
</authorization>
</system.web>
</location>

Ultidev Team
#7 Posted : Saturday, August 19, 2006 5:20:23 AM(UTC)
Ultidev Team

Groups: Administration
Joined: 11/3/2005(UTC)
Posts: 2,253

Thanks: 28 times
Was thanked: 60 time(s) in 59 post(s)
Thank you for sharing!
Your solution is better than the one we have suggested.

Best regards,
UltiDev Team.
Please donate at http://www.ultidev.com/products/Donate.aspx to help us improve our products.
Rss Feed  Atom Feed
Users browsing this topic
Guest (5)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You can vote in polls in this forum.