PC Review


Reply
Thread Tools Rate Thread

asp:image not visible when dynamic

 
 
Deere
Guest
Posts: n/a
 
      23rd Aug 2006
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>

 
Reply With Quote
 
 
 
 
Mark Fitzpatrick
Guest
Posts: n/a
 
      23rd Aug 2006
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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>
>



 
Reply With Quote
 
Deere
Guest
Posts: n/a
 
      23rd Aug 2006
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" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > 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>
> >


 
Reply With Quote
 
Deere
Guest
Posts: n/a
 
      23rd Aug 2006
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" <(E-Mail Removed)> wrote in message
> > news:(E-Mail Removed)...
> > > 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>
> > >


 
Reply With Quote
 
Deere
Guest
Posts: n/a
 
      23rd Aug 2006
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" <(E-Mail Removed)> wrote in message
> > > news:(E-Mail Removed)...
> > > > 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>
> > > >


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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
Inserting image: only bottom of image visible nkittur@gmail.com Microsoft Word Document Management 3 20th Mar 2007 02:41 PM
Get image (BMP) of any visible window? Diego Barros Microsoft Dot NET Framework 0 10th Aug 2005 12:33 PM
make PNG image visible in Excel =?Utf-8?B?ZGRiYg==?= Microsoft Excel Misc 0 12th Sep 2004 09:31 PM
Making Image Visible =?Utf-8?B?R2Vycnk=?= Microsoft Access Forms 2 17th Mar 2004 10:01 PM
Top right image (banner.jpg) isn't visible Thanasis Microsoft Frontpage 6 30th Dec 2003 04:40 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:19 AM.