Forum Moderators: open

Message Too Old, No Replies

Show region broken image IE

shows good in ff but not in ie

         

kristianaxelv

6:47 am on Jun 20, 2009 (gmt 0)

10+ Year Member



hello everybody.
the last 2 weeks i've done my best to learn asp classic and ms access database web development.
Now when my page is as good as done, i tried it in IE7 and i se a problem straight away.
As navigation for my pictures i use 3 thumbs, but when i only have 1 picture and no need for thumbs i get broken image. This only happens in IE though, FF looks perfect. I'm a dreamweaver user and i have used the server behavior "show region if recordset is not empty". and in my world that seems to be right.
I have looked for hours trying to find an answer but with no luck..
I am gratefull for any help, and if needed i can post my code.

Regards
Kristian

kristianaxelv

6:49 am on Jun 20, 2009 (gmt 0)

10+ Year Member



and ofcourse as i forgot, my page:
www.axelv.se

marcel

7:28 am on Jun 20, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



hi kristianaxelv, and Welcome to Webmasterworld! [webmasterworld.com]

Showing a broken image icon is standard behaviour for IE, and as far as I know Firefox used to do this too, but doesn't any more for some reason.

You should avoid outputting an <img> element if you do not have a corresponding image to display. I've never used dreamweaver, so I don't know what the 'show region if recordset is not empty' does exactly, but see if you can change your code so that it only outputs HTML for an <img> when there is an image.

If you're not sure of how to go about this, you can post the corresponding code section for this, and we'll se what is possible.

ps. We're not allowed to post URLs to our own websites here, so it will most likely be removed soom

kristianaxelv

11:11 am on Jun 20, 2009 (gmt 0)

10+ Year Member



hello marcel!

thank you for your advise about the website thing, wont happen again.. :)
here is my code to output my image through my database:

<a href="post.asp?id=<%=(rsPost.Fields.Item("intPostID").Value)%>">
<% If Not rsPost.EOF Or Not rsPost.BOF Then %>
<img src="images/<%=(rsPost.Fields.Item("txtImageSmall").Value)%>" border="0" />
<% End If ' end Not rsPost.EOF Or NOT rsPost.BOF %>

marcel

1:48 pm on Jun 20, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm not too good with classic ASP, but I'll give it a shot :)

This should (hopefully) do the trick:


<a href="post.asp?id=<%=(rsPost.Fields.Item("intPostID").Value)%>">
<% If Not rsPost.EOF Or Not rsPost.BOF Then %>
<% If Not rsPost.Fields.Item("txtImageSmall").Value & "" = "" %>
<img src="images/<%=(rsPost.Fields.Item("txtImageSmall").Value)%>" border="0" />
<% End If %>
<% End If ' end Not rsPost.EOF Or NOT rsPost.BOF %>

kristianaxelv

2:03 pm on Jun 20, 2009 (gmt 0)

10+ Year Member



I thank you very much for paying interest in my post!

I added your code to my page and got this:
Microsoft VBScript compilation error '800a03f9'

Expected 'Then'

/post.asp, line 382

If Not rsPost.Fields.Item("txtImageSmall").Value & "" = ""

i don't know where to put the "then" thing :)
thanks
/kris

marcel

2:14 pm on Jun 20, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



oops, sorry...

Here it is again:


<a href="post.asp?id=<%=(rsPost.Fields.Item("intPostID").Value)%>">
<% If Not rsPost.EOF Or Not rsPost.BOF Then %>
<% If Not rsPost.Fields.Item("txtImageSmall").Value & "" = "" Then %>
<img src="images/<%=(rsPost.Fields.Item("txtImageSmall").Value)%>" border="0" />
<% End If %>
<% End If ' end Not rsPost.EOF Or NOT rsPost.BOF %>

kristianaxelv

2:20 pm on Jun 20, 2009 (gmt 0)

10+ Year Member



ohhhhhhh
can't tell you how happy i am right now haha :)
thanks very much for your help and support even though your not "to good" with classic asp... reason why i started with asp classic was i found a really good video tutorial. got me started perfect :)

cya
Regards
Kris

marcel

11:50 am on Jun 21, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



reason why i started with asp classic was i found a really good video tutorial. got me started perfect

Although Classic ASP is fine, it is a dated technology that will no longer receive new features/updates etc.

If you are just starting you will be much better off learning ASP.Net, a true object oriented programming environment running on the .Net framework.

For videos and tutorials you can't beat the www.asp.net [asp.net] website. They also have some great Starter Kits [asp.net] to help you learn the basics. (you can also use these starter kits as a basis for your own websites/projects)

ANd for a free development environment you can get free versions of Visual Studio here:
http://www.microsoft.com/exPress/ [microsoft.com]

kristianaxelv

2:49 pm on Jun 21, 2009 (gmt 0)

10+ Year Member



this is why i love forums :)
there is no need to study things anymore, everything is
possible to learn right here!
thanks for tips and your help.

/kris