Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / February 2008

Tip: Looking for answers? Try searching our database.

images not showing on dev-machine

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jurjen de Groot - 13 Jan 2008 21:52 GMT
I'm developping a web-app using VS2008 (Pro edition) on a Vista Ultimate
machine
.
For some reason images aren't shown, the only thing shown is the little
square with the circel, triangle and square in it.

Even if I set the ImageURL property in my Page_Load and set it to the
absolute path of the image, it doesn't show.
I have also tried using '~/Images/58.jpg' '/Images/58.jpg' 'Images/58.jpg'
but still the same result.

It's real annoying if something this simple just won't work.

Has anyone encountered this and maybe have some sort of solution for it ?

TIA,
Jurjen.
Alexey Smirnov - 13 Jan 2008 22:37 GMT
On Jan 13, 10:52 pm, "Jurjen de Groot" <Jurjen.de.Gr...@xs4all.nl>
wrote:
> I'm developping a web-app using VS2008 (Pro edition) on a Vista Ultimate
> machine
[quoted text clipped - 13 lines]
> TIA,
> Jurjen.

Ensure that images are appropriately stored and accessible when you
type the full url in the address bar, e.g.

http://localhost/Images/58.jpg (if site is located under root)

if images are there but you can't see them, it could be a permissions
issue, or a format problem
Juan T. Llibre - 13 Jan 2008 22:58 GMT
Does the account ASP.NET runs as have file permissions to access the images ?

Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
> I'm developping a web-app using VS2008 (Pro edition) on a Vista Ultimate machine
> .
[quoted text clipped - 10 lines]
> TIA,
> Jurjen.
Jurjen de Groot - 14 Jan 2008 12:40 GMT
I have taken your advice and found out that my ASPNET account is actually NT
AUTHORITY\NETWORK SERVICE. I have granted this user rights for the Image
folder, but the pictures aren't shown. I've granted this user rights from
the root level of my development folder but still the pictures don't show up
in the page.

I've also tried accessing Image-files through System.IO and reading the
content into a string and that works just fine, so I guess access-rights are
configured ok.

I'm a little lost as to what to do next.

Jurjen.

> I'm developping a web-app using VS2008 (Pro edition) on a Vista Ultimate
> machine
[quoted text clipped - 13 lines]
> TIA,
> Jurjen.
Juan T. Llibre - 14 Jan 2008 14:34 GMT
If the ASP.NET account has the necessary permissions,
it's likely that you have a problem in your code.

Can you post the code you use to access the image files ?

Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
>I have taken your advice and found out that my ASPNET account is actually NT AUTHORITY\NETWORK SERVICE. I have granted
>this user rights for the Image folder, but the pictures aren't shown. I've granted this user rights from the root level
[quoted text clipped - 21 lines]
>> TIA,
>> Jurjen.
Jurjen de Groot - 14 Jan 2008 20:24 GMT
Juan,

It's just a very straightforward simple test-page so here it comes. There's
no code in the code-behind.
The weird thing is that the first and second image don't show in the
(vs2008) Designer, but the other 5 do show just fine. When running the page
they are not visible.

Here's the code I used to access an image file, just to make sure that the
'ASPNET' could :

           String FileName = MapPath("~/Images/58.jpg");
           System.IO.StreamReader sr = new
System.IO.StreamReader(FileName );
           String Content = sr.ReadToEnd();
           sr.Close();

thanks for your effort,
Jurjen.
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TestPage.aspx.cs"
Inherits="<namespace>.WebApplication.TestPage" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:TextBox ID="TextBox1" runat="server" Text="BZP" />&nbsp;&nbsp;
<asp:Button ID="Button1" runat="server" Text="Button"
onclick="Button1_Click" />
<br />
<br />

<asp:Button ID="Button2" runat="server" Text="WebServiceTEst" Visible="True"
onclick="Button2_Click" />
</div>
<img src="/Images/58.jpg" alt="Test " />
<img src="~/Images/58.jpg" alt="Test 2" />
<img src="Images/58.jpg" alt="Test 3" />
<img src="Images/57.gif" alt="Test 4" />
<img src="C:\<ProjectLocation>\Images\57.gif" alt="Test 5" />
<asp:Image ID="test" runat="server" ImageUrl="~/Images/58.jpg" />
<asp:Image ID="Image1" runat="server" ImageUrl="~/Images/57.gif" />
</form>
</body>
</html>

> If the ASP.NET account has the necessary permissions,
> it's likely that you have a problem in your code.
[quoted text clipped - 37 lines]
>>> TIA,
>>> Jurjen.
Alexey Smirnov - 14 Jan 2008 22:56 GMT
On Jan 14, 1:40 pm, "Jurjen de Groot" <Jurjen.de.Gr...@xs4all.nl>
wrote:
> I've also tried accessing Image-files through System.IO and reading the
> content into a string and that works just fine...

Binary read is working.

On Jan 14, 9:24 pm, "Jurjen de Groot" <Jurjen.de.Gr...@xs4all.nl>
wrote:
> the first and second image don't show in the
> (vs2008) Designer, but the other 5 do show just fine. When running the page
> they are not visible.

But browsing in the web browser is not working.

Right?

If the format of the file is correct (it's not a text, or any other
file saved with the .jpg extension) and you can open it in Paint, or
Photoshop, but not in the browser, then it could be a format problem.
There are some situations when browsers (at least IE and FF) cannot
show some jpeg files, if I'm not wrong, in CMYK encoding. In this case
you can save file in RGB to see if this helps.
Jurjen de Groot - 03 Feb 2008 15:05 GMT
Now that the app is running in test in the field, the images are shown just
fine. It's just really strange that when running local there's problem with
this.
Thanks for all your help on this.

Jurjen

> I'm developping a web-app using VS2008 (Pro edition) on a Vista Ultimate
> machine
[quoted text clipped - 13 lines]
> TIA,
> Jurjen.
John Kotuby - 06 Feb 2008 22:07 GMT
Try going into IIS Manager and for your Default Web Site set the Home
Directory to the path on disk where your website resides. For me it is
C:\Development\Project23.net (my current web project).

That will upset some other programs that do web demos on your local machine,
like some 3rd party controls that demonstrate their stuff using the local
web server and expect C:\inetpub\wwwroot to be your home directory, but you
can change it back and forth as needed.

It works well for me and allows me to test and debug my projects as if they
were on the production server.

> Now that the app is running in test in the field, the images are shown
> just fine. It's just really strange that when running local there's
[quoted text clipped - 20 lines]
>> TIA,
>> Jurjen.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.