473,395 Members | 2,446 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,395 software developers and data experts.

asp:image not visible when dynamic

When I try to take a database field and change it with a function and
return it...it will not display the image. The "Imageurl" does not
convert to "src=" but stays as ImageUrl.

id=Image2 will display ok ..and shows in view source as .......

<img id="gvwExample_ctl07_Image2"
src=".\images\toys\1_16\thumb\t_15511.jpg" style="border-width:0px;" />
id=Image3 will not display image and shows in view source as.......

<asp:Image id="Image3" ImageUrl=".\images\toys\1_16\thumb\t_15511.jpg"
runat="server" />

What am I doing wrong.....thanks

the "imageref": field below starts out as
".\images\toys\1_16\15511.jpg"
the function returns ".\images\toys\1_16\thumb\t_15511.jpg"

Code:

<asp:TemplateField HeaderText="Image">
<ItemTemplate>
<asp:Image id="Image2"
ImageUrl=".\images\toys\1_16\thumb\t_15511.jpg" runat="server" />
<asp:Image id="Image3"
ImageUrl="<%#testthis(Eval("imageref"))%>" runat="server" />
</ItemTemplate>
</asp:TemplateField>

Aug 22 '06 #1
4 4878
Your slashes are in the wrong direction. They should be / instead of \

It could be that IE is able to translate it around, but ASP.Net could be
getting stuck as it will try to verify the path.

Hope this helps,
Mark Fitzpatrick
Microsoft MVP - FrontPage

"Deere" <me******@yahoo.comwrote in message
news:11**********************@i3g2000cwc.googlegro ups.com...
When I try to take a database field and change it with a function and
return it...it will not display the image. The "Imageurl" does not
convert to "src=" but stays as ImageUrl.

id=Image2 will display ok ..and shows in view source as .......

<img id="gvwExample_ctl07_Image2"
src=".\images\toys\1_16\thumb\t_15511.jpg" style="border-width:0px;" />
id=Image3 will not display image and shows in view source as.......

<asp:Image id="Image3" ImageUrl=".\images\toys\1_16\thumb\t_15511.jpg"
runat="server" />

What am I doing wrong.....thanks

the "imageref": field below starts out as
".\images\toys\1_16\15511.jpg"
the function returns ".\images\toys\1_16\thumb\t_15511.jpg"

Code:

<asp:TemplateField HeaderText="Image">
<ItemTemplate>
<asp:Image id="Image2"
ImageUrl=".\images\toys\1_16\thumb\t_15511.jpg" runat="server" />
<asp:Image id="Image3"
ImageUrl="<%#testthis(Eval("imageref"))%>" runat="server" />
</ItemTemplate>
</asp:TemplateField>

Aug 23 '06 #2
Thanks for your response Mark but my test show the image will not
dispIay if the path slashes are / ... If you look at the the literal or
static path of Image2 which is / it will display. Its just the dynamic
return of the Image3 path that won't, even though it returns the same
path as the test static path of Image2

Any other thoughts would be appreciated.
Mark Fitzpatrick wrote:
Your slashes are in the wrong direction. They should be / instead of \

It could be that IE is able to translate it around, but ASP.Net could be
getting stuck as it will try to verify the path.

Hope this helps,
Mark Fitzpatrick
Microsoft MVP - FrontPage

"Deere" <me******@yahoo.comwrote in message
news:11**********************@i3g2000cwc.googlegro ups.com...
When I try to take a database field and change it with a function and
return it...it will not display the image. The "Imageurl" does not
convert to "src=" but stays as ImageUrl.

id=Image2 will display ok ..and shows in view source as .......

<img id="gvwExample_ctl07_Image2"
src=".\images\toys\1_16\thumb\t_15511.jpg" style="border-width:0px;" />
id=Image3 will not display image and shows in view source as.......

<asp:Image id="Image3" ImageUrl=".\images\toys\1_16\thumb\t_15511.jpg"
runat="server" />

What am I doing wrong.....thanks

the "imageref": field below starts out as
".\images\toys\1_16\15511.jpg"
the function returns ".\images\toys\1_16\thumb\t_15511.jpg"

Code:

<asp:TemplateField HeaderText="Image">
<ItemTemplate>
<asp:Image id="Image2"
ImageUrl=".\images\toys\1_16\thumb\t_15511.jpg" runat="server" />
<asp:Image id="Image3"
ImageUrl="<%#testthis(Eval("imageref"))%>" runat="server" />
</ItemTemplate>
</asp:TemplateField>
Aug 23 '06 #3
Mark sorry I was wrong, the image will display no matter which way
the slashes are. I overwrote a letter when changing the slashes
eariler.

Deere wrote:
Thanks for your response Mark but my test show the image will not
dispIay if the path slashes are / ... If you look at the the literal or
static path of Image2 which is / it will display. Its just the dynamic
return of the Image3 path that won't, even though it returns the same
path as the test static path of Image2

Any other thoughts would be appreciated.
Mark Fitzpatrick wrote:
Your slashes are in the wrong direction. They should be / instead of \

It could be that IE is able to translate it around, but ASP.Net could be
getting stuck as it will try to verify the path.

Hope this helps,
Mark Fitzpatrick
Microsoft MVP - FrontPage

"Deere" <me******@yahoo.comwrote in message
news:11**********************@i3g2000cwc.googlegro ups.com...
When I try to take a database field and change it with a function and
return it...it will not display the image. The "Imageurl" does not
convert to "src=" but stays as ImageUrl.
>
id=Image2 will display ok ..and shows in view source as .......
>
<img id="gvwExample_ctl07_Image2"
src=".\images\toys\1_16\thumb\t_15511.jpg" style="border-width:0px;" />
>
>
id=Image3 will not display image and shows in view source as.......
>
<asp:Image id="Image3" ImageUrl=".\images\toys\1_16\thumb\t_15511.jpg"
runat="server" />
>
What am I doing wrong.....thanks
>
>
>
the "imageref": field below starts out as
".\images\toys\1_16\15511.jpg"
the function returns ".\images\toys\1_16\thumb\t_15511.jpg"
>
Code:
>
<asp:TemplateField HeaderText="Image">
<ItemTemplate>
<asp:Image id="Image2"
ImageUrl=".\images\toys\1_16\thumb\t_15511.jpg" runat="server" />
<asp:Image id="Image3"
ImageUrl="<%#testthis(Eval("imageref"))%>" runat="server" />
</ItemTemplate>
</asp:TemplateField>
>
Aug 23 '06 #4
I got it to work by switching the double quotes to single on this
ImageUrl="<%#testthis(Eval("imageref"))%>" to
ImageUrl='<%#testthis(Eval("imageref"))%>'
not sure why as I had single quotes originally...sheesh programming
Deere wrote:
Mark sorry I was wrong, the image will display no matter which way
the slashes are. I overwrote a letter when changing the slashes
eariler.

Deere wrote:
Thanks for your response Mark but my test show the image will not
dispIay if the path slashes are / ... If you look at the the literal or
static path of Image2 which is / it will display. Its just the dynamic
return of the Image3 path that won't, even though it returns the same
path as the test static path of Image2

Any other thoughts would be appreciated.
Mark Fitzpatrick wrote:
Your slashes are in the wrong direction. They should be / instead of \
>
It could be that IE is able to translate it around, but ASP.Net could be
getting stuck as it will try to verify the path.
>
Hope this helps,
Mark Fitzpatrick
Microsoft MVP - FrontPage
>
"Deere" <me******@yahoo.comwrote in message
news:11**********************@i3g2000cwc.googlegro ups.com...
When I try to take a database field and change it with a function and
return it...it will not display the image. The "Imageurl" does not
convert to "src=" but stays as ImageUrl.

id=Image2 will display ok ..and shows in view source as .......

<img id="gvwExample_ctl07_Image2"
src=".\images\toys\1_16\thumb\t_15511.jpg" style="border-width:0px;" />


id=Image3 will not display image and shows in view source as.......

<asp:Image id="Image3" ImageUrl=".\images\toys\1_16\thumb\t_15511.jpg"
runat="server" />

What am I doing wrong.....thanks



the "imageref": field below starts out as
".\images\toys\1_16\15511.jpg"
the function returns ".\images\toys\1_16\thumb\t_15511.jpg"

Code:

<asp:TemplateField HeaderText="Image">
<ItemTemplate>
<asp:Image id="Image2"
ImageUrl=".\images\toys\1_16\thumb\t_15511.jpg" runat="server" />
<asp:Image id="Image3"
ImageUrl="<%#testthis(Eval("imageref"))%>" runat="server" />
</ItemTemplate>
</asp:TemplateField>
Aug 23 '06 #5

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

Similar topics

1
by: John Scott | last post by:
I am storing an image in an SQL database and have one field as an image datatype. I am also using a webservice to transport data. I want to be able to resize the image and pass back a thumbnail...
6
by: C K | last post by:
What is less expensive/intensive on the server -dynamically writing out my rollovers to an asp:literal, or to use asp:image tags for the images. My image names will be dynamic as I am building a...
1
by: nicholas | last post by:
Why is this not working ?? <asp:Image ID="myimage" ImageUrl='/aspx_scripts/thumbnailimage.aspx?filename=/files/products/image1/ <%# DataBinder.Eval(Container.DataItem, "productID") %><%#...
0
by: DavidS | last post by:
I have HTML web page with <asp:Image id=img_L runat=server ImageAlign=Top Visible=True Width=y Height=x></asp:Image>. For some images, less than 128K I can view image. Other image files > 128K,...
1
by: R.A.M. | last post by:
Hello, Could you help me please with a problem concerning handling at server asp:Images? I have <asp:Image ID="DotNETImage" ImageUrl="Images/DotNET_360x280.jpeg" AlternateText="Microsoft .NET...
4
by: mc | last post by:
Scenario: I have a database of companys, and a directory of images, each image has the name of one of the companys, although not all companys have images. I want a page which displays the...
3
by: Switch4Mac | last post by:
Hi, I want to insert an ad in my MasterPage. So in the MasterPage, I have this piece of code: <asp:Image ID="GatesAd" runat="server"...
0
by: Christian Schlemmer | last post by:
hi, in a DetailsView i have a image display. images i want to store in a seperate directory, but it a path is added to Bind update and delete is not working. just Bind makes my...
3
by: Paul Cheetham | last post by:
Hi, I have an application that will display user-defined images in some asp:image controls. (sets the ImageURL, and is always built from the site root) The problem comes when the images...
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: 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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.