Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Image In User Control

Reply
Thread Tools

Image In User Control

 
 
RN1
Guest
Posts: n/a
 
      08-07-2008
A user control has an image & a few Labels. When I view the ASPX page
that uses this user control in my local machine, the image can be seen
but when I upload the ASPX page & the ASCX page to my remote server,
the ASPX page shows the Labels but it doesn't show the image.
Strangely the source code of the ASPX page includes the image code.

What could the problem be?

Thanks,

Ron
 
Reply With Quote
 
 
 
 
Munna
Guest
Posts: n/a
 
      08-07-2008
Hi,

Check the source of the image...
a relative url will work okay in every case if you have the image in
your project...
perhaps you are working with absolute URL...


Best of luck

-------
Munna

www.munna.shatkotha.com/blog
www.munna.shatkotha.com
www.shatkotha.com
 
Reply With Quote
 
 
 
 
RN1
Guest
Posts: n/a
 
      08-07-2008
On Aug 7, 11:15*am, Munna <munna...@gmail.com> wrote:
> Hi,
>
> Check the source of the image...
> a relative url will work okay in every case if you have the image in
> your project...
> perhaps you are working with absolute URL...
>
> *Best of luck
>
> -------
> Munna
>
> http://www.munna.shatkotha.com/blogw....shatkotha.com


When the image wasn't getting rendered, I was using

<table background="\Images\Stars.gif">

When I changed it to

<table background="Images\Stars.gif">

the image gets rendered. Why so?

Thanks,

Ron
 
Reply With Quote
 
michel.desangles@gmail.com
Guest
Posts: n/a
 
      08-07-2008
On 7 août, 09:27, RN1 <r...@rediffmail.com> wrote:
> On Aug 7, 11:15*am, Munna <munna...@gmail.com> wrote:
>
> > Hi,

>
> > Check the source of the image...
> > a relative url will work okay in every case if you have the image in
> > your project...
> > perhaps you are working with absolute URL...

>
> > *Best of luck

>
> > -------
> > Munna

>
> >http://www.munna.shatkotha.com/blogw....shatkotha.com

>
> When the image wasn't getting rendered, I was using
>
> <table background="\Images\Stars.gif">
>
> When I changed it to
>
> <table background="Images\Stars.gif">
>
> the image gets rendered. Why so?
>
> Thanks,
>
> Ron


If you prefix your path with a \, you indicate that the path is
relative to the site's root. If the path is relative to the page,
don't use the first \. For instance, if your site has this structure :

Default.aspx
SomeFolder/
SomeFolder/MyPage.aspx
SomeFolder/Pics/
SomeFolder/Pics/mypic.gif

...and your table is in the "MyPage.aspx", specifying this path for
the image :

\Pics\mypic.gif

...would look for a "Pics" folder at the root of the site. As there
isn't one, nothing happens. Whereas this:

Pics\mypic.gif

...would look for a "Pics" folder at the same level as the containg
page, that is, inside "SomeFolder".

(also, as you're dealing with Urls and not the filesystem, you should
use forward slashes instead of backslashes. The framework translates
for you, but it's just a good habit to have).

Michel
 
Reply With Quote
 
 
 
Reply

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
User Control to Control Other User Control Jonathan Wood ASP .Net 4 02-02-2010 03:41 PM
persisting changes to a control outside a user control from the user control? Mad Scientist Jr ASP .Net 0 03-22-2006 08:02 AM
Event not firing for user control inside user control vatech1993 ASP .Net 4 12-11-2004 02:51 PM
Creating user control/custom image control to handle multilingual site SamIAm ASP .Net 1 10-17-2003 08:41 AM
Manipulating a User Control from another User Control Tom Rowton ASP .Net 2 08-01-2003 08:18 PM



Advertisments