473,378 Members | 1,622 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,378 software developers and data experts.

Displaying a .jpg on an .aspx page

3
Hi,-

I am wondering how one can make an .aspx page display an image whose url is given in the code-behind. I have some .jpg files in my database, whose urls I retrieve as the page loads and want to display on the page.

In my .aspx file, I have:
Expand|Select|Wrap|Line Numbers
  1.   <asp:Image runat="server" ID="image" Visible ="true" /> 
And i my .aspx.vb file, the following:

Expand|Select|Wrap|Line Numbers
  1. Dim url as String = database.getUrlForImage(imageId) 'get path to this image from the DB
  2. image.ImageUrl = url
  3. image.DataBind() 
When debugging, I notice that the ImageUrl property is being set correctly, however the page does not display it.

What is the problem?

Thank you very much.

Vahagn
Jan 19 '08 #1
1 928
kenobewan
4,871 Expert 4TB
Make sure that the url variable is a virtual path "~/imagename.jpg"
Jan 20 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Wynter | last post by:
RE: from Displaying a Document using the ASPNET user account to the Client Browser discussion (3/2/2004 Buddy Thanks for helping me on getting the document to display. But now I am left with a...
2
by: Carole MacDonald | last post by:
There have been lots of posts on this topic, but I haven't been able to apply any of the suggestions to my situation. I have an .aspx page with a form on it that has several submit buttons on...
0
by: Fronky | last post by:
Hope someone can help. I am still learning, so no laughing please. I am displaying records from a database using Response.Write(""); instead of the usual datagrid method. I am doing it this way...
3
by: vinayak | last post by:
Hi I am displaying data in Datagrid in ASP.NET with Edit/Update functionality for each row. On the same page I have 2 Button controls which submits the request to server. These button controls...
0
by: Coco | last post by:
Hi! I have been searching for solution for the problem i am facing in displaying chinese character in my aspx page initially when i created the aspx page with some chinese chaarcter, it worked...
2
by: mazdotnet | last post by:
Hi, I have the following code in the code-behind file public string section; section = Request.ToString() and I like to display it in my .aspx page (included .ascx) but it's not working.
15
by: Kevin Hanken | last post by:
Hi, Pretty much a newbie to aspnet and xp -- I am using XP Pro, Service Pack 2. I installed IIS, set up a virtual directory, created an aspx file and pasted in a little code from the w3schools...
11
by: pardesiya | last post by:
Friends, I am having trouble displaying Japanese text within a textbox (or anywhere else) in an aspx page with .net 2.0 framework. Initial default text in Japanese displays perfectly but when I...
7
by: hsegoy1979 | last post by:
Dear All Iam using file upload control and i want to display image in another pop up page .But image is not displaying in image control iam sending image path thru querystring . here is my code ...
7
by: RichB | last post by:
I am trying to get to grips with the asp.net ajaxcontrol toolkit, and am trying to add a tabbed control to the page. I have no problems within the aspx file, and can dynamically manipulate a...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.