473,785 Members | 2,602 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1557
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="\Im ages\Stars.gif" >

When I changed it to

<table background="Ima ges\Stars.gif">

the image gets rendered. Why so?

Thanks,

Ron
Aug 7 '08 #3
On 7 août, 09:27, RN1 <r...@rediffmai l.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="\Im ages\Stars.gif" >

When I changed it to

<table background="Ima ges\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.asp x", 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
2220
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. There appears to be just two types of controls that support this action: OLE controls and Hyperlink text boxes. I am using the hyperlink. Dragging the images into the hyperlink works just fine, but I'm quite dismayed about the lack of control over...
2
20685
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 I cannot get this to change from the code behind of a page that hosts the user control.
3
29945
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 picturebox. But at the same time I want to refer only assembly of the user control in other solution. If I am using method System.Drawing.Image.FromFile("filename") I have to put gif files containing those images in bin directory of solution in...
0
2299
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 tab, I am loosing the file in the file control. So, I am putting the file in a Session: Session("PhotoFile") = filePhoto.PostedFile When the user comes back to the tab with the File upload, an Image control
7
3400
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
11639
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 is proving to be more difficult. These pictureboxes are bound to an AccessDB. If the user wants to add an image, they select an image using an OpenFileDialog: Dim result As DialogResult = Pic_Sel.ShowDialog() If (result = DialogResult.OK) Then
5
2559
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 problem is that i am not able to get the latest image on the page, it keeps showing the old page. But when i hit the refresh button on the toolbar it correctly gets the latest image and displays it in the control. But that has another problem, it...
9
1871
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", and an option for the user to update the photo. If they click the update button, I then flip up a new panel, where I have a FileUpload control and corresponding Upload Button. If they load an image file and click the Upload button, my code uses...
2
2802
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 fileName or a webpage that writes. But I don't want to have to write my bitmap to a file, I just want to put it into the image. Can this be done? It seams that an image control should be designed to that it could accept a bitmap (duh) but I...
1
2871
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'); background-position:center; background-repeat:no- repeat;" <!-- My footer content goes here. --</div> This Footer.ascx is under a folder called /UserControls (the leading forward slash indicates the root of the web application, same below).
0
9481
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10095
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9953
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7502
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6741
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5383
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5513
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4054
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2881
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.