images not showing on dev-machine

images not showing on dev-machine

am 13.01.2008 22:52:25 von Jurjen de Groot

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.

Re: images not showing on dev-machine

am 13.01.2008 23:37:52 von lexa

On Jan 13, 10:52=A0pm, "Jurjen de Groot"
wrote:
> 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.

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

Re: images not showing on dev-machine

am 13.01.2008 23:58:40 von nomailreplies

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/
======================================
"Jurjen de Groot" wrote in message news:e$8kq6iVIHA.6092@TK2MSFTNGP06.phx.gbl...
> 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.

Re: Extra Information, problem not solved yet

am 14.01.2008 00:41:51 von nomailreplies

re:
!> I thought that since it is visible in vs2008 and not in IE that it might be
!> a security problem, but I've given read rights to the image folder to
!> 'Everyone' so that shouldn't be it.

Giving permissions to 'Everyone' is not enough.
Permissions must be given to the account ASP.NET runs as.

Unless you're impersonating, under XP the right account is the MachineName\ASPNET account.

If you don't know which account ASP.NET runs as, save the following as "identity.aspx" and run it:

identity.aspx:
--------------------
<%@ Page Language="VB" %>
<%@ Import NameSpace = System.Security.Principal %>



What account is ASP.NET running as ?









-----------

That code will return the correct account you need to give access permissions to.



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/
======================================
"Jurjen de Groot" wrote in message news:OwadwRjVIHA.5208@TK2MSFTNGP04.phx.gbl...
> My images are stored in the Images folder in the root of my project.
> I have created a test-page in which i have the a few controls like this :
>
> Test
> Test 2
> Test 3
> Test 4
> Test 5
>
>
>
>
> In VS2008 in 'design' view the pictures are shown just fine, after pressing
> F5 the pictures don't show in Internet explorer (i have attached a small
> prt-scr image), when asking for the source this is shown:
>
> Test
> Test 2
> Test 3
> Test 4
> Test 5
>
>
>
>
> I thought that since it is visible in vs2008 and not in IE that it might be
> a security problem, but I've given read rights to the image folder to
> 'Everyone' so that shouldn't be it. I've also deployed this to another
> machine (XP Pro) and there the pictures also don't show.
>
>
> Jurjen
>
>
> "Jurjen de Groot" wrote in message
> news:e$8kq6iVIHA.6092@TK2MSFTNGP06.phx.gbl...
>> 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.
>

It"s not access-rights (I think)

am 14.01.2008 13:40:05 von Jurjen de Groot

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.


"Jurjen de Groot" wrote in message
news:e$8kq6iVIHA.6092@TK2MSFTNGP06.phx.gbl...
> 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.

Re: It"s not access-rights (I think)

am 14.01.2008 15:34:17 von nomailreplies

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/
======================================
"Jurjen de Groot" wrote in message news:OhyJvqqVIHA.5164@TK2MSFTNGP03.phx.gbl...
>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.
>
>
> "Jurjen de Groot" wrote in message news:e$8kq6iVIHA.6092@TK2MSFTNGP06.phx.gbl...
>> 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.
>

Re: Extra Information, problem not solved yet

am 14.01.2008 18:36:06 von George Ter-Saakov

1. It's wrong to use "~" in urls (or src) if you do not have runat=server.
The reason is that only for HTML tags marked as runat=server src is
processed with .NET and ~ is replaced.

2. "/Image/58.jpg" is called absolute address cause it starts with "/". "/"
means root of the webserver not a root of the project. So most likely you
should have "/ProjectName/Iamge/58.jpg"

3. "Images/58.jpg" is called relative address. Browser resolves it to
absolute address based on where page is.
If page's URL is http://localhost/project/myfolder/mypage.aspx then
"Images/58.jpg" will be resolved to
http://localhost/project/myfolder/Images/58.jpg

So most likely solution to your problem is to specify correct absolute
address for your images
like "/ProjectName/Iamge/58.jpg"

George.

"Jurjen de Groot" wrote in message
news:OwadwRjVIHA.5208@TK2MSFTNGP04.phx.gbl...
> My images are stored in the Images folder in the root of my project.
> I have created a test-page in which i have the a few controls like this :
>
> Test
> Test 2
> Test 3
> Test 4
> Test 5
>
>
>
>
> In VS2008 in 'design' view the pictures are shown just fine, after
> pressing
> F5 the pictures don't show in Internet explorer (i have attached a small
> prt-scr image), when asking for the source this is shown:
>
> Test
> Test 2
> Test 3
> Test 4
> Test 5
>
>
>
>
> I thought that since it is visible in vs2008 and not in IE that it might
> be
> a security problem, but I've given read rights to the image folder to
> 'Everyone' so that shouldn't be it. I've also deployed this to another
> machine (XP Pro) and there the pictures also don't show.
>
>
> Jurjen
>
>
> "Jurjen de Groot" wrote in message
> news:e$8kq6iVIHA.6092@TK2MSFTNGP06.phx.gbl...
>> 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.
>

Re: It"s not access-rights (I think)

am 14.01.2008 21:24:56 von Jurjen de Groot

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=".WebApplication.TestPage" %>
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">



Untitled Page




  
onclick="Button1_Click" />





onclick="Button2_Click" />

Test
Test 2
Test 3
Test 4
Test 5








"Juan T. Llibre" wrote in message
news:OLuwMqrVIHA.1184@TK2MSFTNGP04.phx.gbl...
> 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/
> ======================================
> "Jurjen de Groot" wrote in message
> news:OhyJvqqVIHA.5164@TK2MSFTNGP03.phx.gbl...
>>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.
>>
>>
>> "Jurjen de Groot" wrote in message
>> news:e$8kq6iVIHA.6092@TK2MSFTNGP06.phx.gbl...
>>> 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.
>>
>
>

Re: It"s not access-rights (I think)

am 14.01.2008 23:56:55 von lexa

On Jan 14, 1:40 pm, "Jurjen de Groot"
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=A0pm, "Jurjen de Groot"
wrote:
> the first and second image don't show in the
> (vs2008) Designer, but the other 5 do show just fine. When running the pag=
e
> 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.