473,396 Members | 1,917 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Image In User Control

RN1
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
Aug 7 '08 #1
3 1535
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
Aug 7 '08 #2
RN1
On Aug 7, 11:15*am, Munna <munna...@gmail.comwrote:
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
Aug 7 '08 #3
On 7 août, 09:27, RN1 <r...@rediffmail.comwrote:
On Aug 7, 11:15*am, Munna <munna...@gmail.comwrote:
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
Aug 7 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Fred R | last post by:
I'm designing an app in Access 97 that will facilitate the uploading of records and images to a website. The user selects the image thumbnails from the file system and drags them into the app....
2
by: Mark Kamoski | last post by:
How can one change an image url at runtime? (Note, the image exists in a user control.) This is the image tag on the ascx... <asp:image id="TopBanner" runat="server"></asp:image> ....but...
3
by: Shailaja Kulkarni | last post by:
hi All, This problem is for C# windows application. I have a user control whcih contains one picture box along with other controls. Depending on certain conditions I want to change images on the...
0
by: Satish Appasani | last post by:
Hi: I have a ASP.NET form with Web layout which I've achieved using panels. In one of the tab I have a File control to upload Images. When I put a file in the file control and move to another...
7
by: Scott Schluer | last post by:
Is there a way to use the Image class to convert a color photo (GIF or JPEG) to a B&W photo? Thanks, Scott
7
by: lgbjr | last post by:
Hello All, I¡¯m using a context menu associated with some pictureboxes to provide copy/paste functionality. Copying the image to the clipboard was easy. But pasting an image from the clipboard...
5
by: ramendra | last post by:
how to refresh a image control to pick up the latest image file on a asp.net page. i am generating a image based on the input from the user and displaying it on the page through image control. The...
9
by: Mark Denardo | last post by:
This is related to another post I submitted, but I'll be more precise this time. I have a web page that contains an Image webcontrol that loads its image by: Image1.ImageUrl="<username>.jpg",...
2
by: Tina | last post by:
I have a System.Drawing.Bitmap myImage; I also have a webcontrols.Image on my web page. I want to put the bitmap into the image but the image can only get it's bitmap from ImageURL which can be a...
1
by: gnewsgroup | last post by:
I have a user control called Footer.ascx, in which a background image is inserted like so: <div id="footerdiv" style="background-image:url('Images/ mybackground.jpg');...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.