473,769 Members | 2,141 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

asp code does not render for first record in looped recordset

I have posted this question on a javascript forum as it contains
javascript code however it was believed to be an asp issue.

The following head section javascript code contains the function
showBigImage( isource,bigImag e,header ) function call of discussion:

var currentImage;
function showBigImage( isource,bigImag e,header ) {
var theImage = document.getEle mentById( 'largeimage' );
theImage.src = isource;
currentImage = bigImage;
document.getEle mentById( 'photoHeader' ).innerHTML=hea der;
document.getEle mentById( 'largeimage' ).alt=header;

The following rendered looped recordset code illustrates how the
"header" parameter of this showBigImage( isource,bigImag e,header )
function call does not render ONLY FOR THE FIRST RECORD OF THE
RECORDSET as it is blank:

<a href= "javascript :;" <td height=36 valign="middle"
class="small_im g" onmouseover="sh owBigImage( 'imagescript.as p?
path=images/portable_stage. jpg&width=250', 'images/
portable_stage. jpg','' )"<img src="imagescrip t.asp?path=imag es/
portable_stage. jpg&width=36" border="0" alt="" /</td</a>

<a href= "javascript :;" <td height=36 valign="middle"
class="small_im g" onmouseover="sh owBigImage( 'imagescript.as p?
path=images/seated_riserset .jpg&width=250' ,'images/
seated_riserset .jpg','Portable stage configuration using 9 units of
the 3 ft x 8 ft platforms in 3 different heights' )"<img
src="imagescrip t.asp?path=imag es/seated_riserset .jpg&width=36"
border="0" alt="" /</td</a>

<a href= "javascript :;" <td height=36 valign="middle"
class="small_im g" onmouseover="sh owBigImage( 'imagescript.as p?
path=images/Stageset.jpg&wi dth=250','image s/Stageset.jpg',' Portable
stage configuration using 16 units of the 4 ft x 8 ft platforms' )">
<img src="imagescrip t.asp?path=imag es/Stageset.jpg&wi dth=36"
border="0" alt="" /</td</a>

<a href= "javascript :;" <td height=36 valign="middle"
class="small_im g" onmouseover="sh owBigImage( 'imagescript.as p?
path=images/Runset.jpg&widt h=250','images/Runset.jpg','Po rtable stage
runset configuration' )"<img src="imagescrip t.asp?path=imag es/
Runset.jpg&widt h=36" border="0" alt="" /</td</a>
Because of this problem, the caption text does not display for this
first image record once the thumbnail images are moused over. You can
view this page example at
http://www.canchair.com/new_web_prod...ctFamilySub=10
Jul 22 '08
16 2594
ha**@canchair.c om wrote on Wed, 23 Jul 2008 07:45:54 -0700 (PDT):
This is the code to narrow in on:
onmouseover="sh owBigImage( 'imagescript.as p?path=<%=
images.Fields.I tem( "url_img" ).Value %>&width=250',' <%=
images.Fields.I tem( "url_img" ).Value %>','<
%=(images.Field s.Item("alt_img ").Value)%> ' )">
This '<%=(images.Fie lds.Item("alt_i mg").Value)%> ' portion of the code
is what is not rendering for the initial image of the recordset

Silly question, but are you sure the value of alt_img for that row in the
database actually has a value?

And another thing to consider (which shouldn't affect this though) is that
you should ensure that there is no way to get an apostrophe into your
database, or if you do allow it that you ensure that you escape it (ie store
it as \') or else you risk breaking the javascript handling in the client
(or even worse potentially allowing cross-site scripting).

--
Dan
Jul 23 '08 #11
Not sure why some posters thought this had anything to do with JS and nothing
to do with recordset.

I certainly don't know anything other than a recordset object that uses the
code pattern
[name].Field.Item('.. .fieldname...") .Value

Now, it's also true that DumbWeaver is plunking in way too much code there.

The expression
<% = images.Fields.I tem( "url_img" ).Value %>
is 100% equivalent to the easier-to-write, easier-to-read, and MEASURABLY
FASTER
<%=images("url_ img")%>
And I do recommend that you switch to that.

***************

Having said all that.

I see no reason at all in any of your code that the first description
doesn't show up in the output. (And it's clearly nothing to do with
apostrophes...a VIEW-->>SOURCE of the HTML of your page shows that there is
NOTHING WHATSOEVER there.)

So I have to question your actual database. Are you 100% *SURE* that you
actually *HAVE* any text in the
alt_img
field for that given
url_img
value????

In other words, go into your Access database (using Access, not using ASP,
not using DumbWaster) and find the record where
url_img
is
images/portable_stage. jpg
Then, *IN THAT SAME RECORD*, find what the value of
alt_img
is. I am personally betting that the value is blank. And so you are
getting exactly what you should.

*************** *******

I do note that your code isn't *REALLY* doing what it *SHOULD* be doing.

You said to look at the URL
http://www.canchair.com/new_web_prod...ctFamilySub=10

I did. I also looked at
ProductID=111
and
ProductFamilySu b=12
and tried various other combinations. And I still got the same images, no
matter what.

So given all that, maybe it's not surprising that the DB doesn't have a
value in one field when you think it should.

*************** *************** *******

By the not so insignifcant by...your HTML code is ILLEGAL. It is rendering
thus:

<a href= "javascript :;" class="small_im g" >
<td height=36 valign="middle" class="small_im g"
onmouseover="sh owBigImage(
'imagescript.as p?path=images/portable_stage. jpg&width=250', 'images/portable_stage. jpg',''
)"><img src="imagescrip t.asp?path=imag es/portable_stage. jpg&width=36"
border="0" alt="" </td>
</a>
But it's illegal to have <A>...</Atags *OUTSIDE* of the <TD>...</TDtags.

As it turns out, MSIE is sloppy and allows this. Don't count on other
browser to do so.

Of course, the bigger question is a simple one: What's the point of the <A>
tag there, in the first place????? It is doing EXACTLY NOTHING. I would
string recommend removing the <Aand </Atags.

Jul 23 '08 #12
Old Pedant wrote:
Not sure why some posters thought this had anything to do with JS and
nothing
to do with recordset.
If you're asking why I missed it, the answer is simple: I do not expect to
see a recordset object named "images". Even if I had, I still had not seen
enough to decide where the problem was.
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Jul 23 '08 #13
"Bob Barrows [MVP]" wrote:
If you're asking why I missed it, the answer is simple: I do not expect to
see a recordset object named "images".
I thought you weren't only one that missed that. I thought a couple of
other posters did.

But no matter. It's obvious you haven't had to work with the junk that DW
produces as much as I have. I recognized its patterns (even its BigImage
stuff) right off. I think, all in all, you should consider yourself very
fortunate. <grin/>

[I admit, I tend to go overboard, ragging on DreamWeaver, but sheesh!
They've been producing the same crappy code since 1998 or so. I'm sure
nobody is doing any active work on improving it, today, but you'd think that
SOMEBODY would have changed SOME of their idiocies back in 2000 through 2002
or so.]


Even if I had, I still had not seen
enough to decide where the problem was.
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Jul 24 '08 #14
Old Pedant wrote:
[I admit, I tend to go overboard, ragging on DreamWeaver, but sheesh!
They've been producing the same crappy code since 1998 or so. I'm sure
nobody is doing any active work on improving it, today, but you'd think that
SOMEBODY would have changed SOME of their idiocies back in 2000 through 2002
or so.]
Dreamweaver CS4 is in public beta, all they did was break the UI and
improve the CSS abilities. The server side code hasn't changed since DW8
where they introduced paramatised commands to help prevent SQL injection.

Dreamweaver users have been screaming out for improved server side code
support for many years. Due to the poor support of server side code, and
regular browsing of this newsgroup, I have improved my asp/vbscript
coding abilities, but still use Dreamweaver to "design" my web applications.

Steve
Jul 24 '08 #15


"Dooza" wrote:
Dreamweaver users have been screaming out for improved server side code
support for many years. Due to the poor support of server side code, and
regular browsing of this newsgroup, I have improved my asp/vbscript
coding abilities, but still use Dreamweaver to "design" my web applications.
A smart person, you are. The dozen or so people who I've taken "in hand" do
pretty much the same thing: Do the HTML design with DW but then do all the
ASP coding (or at least much of it) by hand.

If nothing else, the amount of "kruft" that you get rid of that way makes
your pages run twice as fast.

[I don't do much HTML "design", and what I do is done with notepad or VS
2003, even when coding in ASP. I'm lucky in that I get to be the "backend"
to designers' front-ends.]
Jul 24 '08 #16
Old Pedant wrote:
>
"Dooza" wrote:
>Dreamweaver users have been screaming out for improved server side code
support for many years. Due to the poor support of server side code, and
regular browsing of this newsgroup, I have improved my asp/vbscript
coding abilities, but still use Dreamweaver to "design" my web applications.

A smart person, you are. The dozen or so people who I've taken "in hand" do
pretty much the same thing: Do the HTML design with DW but then do all the
ASP coding (or at least much of it) by hand.
I recently found out that Stored Procedures can output more than 1
recordset, and that you can easily step to the next one in ASP/VBScript.
This is something Dreamweaver will never do, yet it can save you
making several trips to the database. Since I do everything I can with
Stored Procedures to keep my database as secure as possible, this is a
great trick to use.
If nothing else, the amount of "kruft" that you get rid of that way makes
your pages run twice as fast.

[I don't do much HTML "design", and what I do is done with notepad or VS
2003, even when coding in ASP. I'm lucky in that I get to be the "backend"
to designers' front-ends.]
I have always been a visual designer. One of my early jobs in tech
support was for HoTMetaL Pro. The only way to support a package like
that was to learn what it was trying to do. I soon found it was bloody
awful at making good code! So I bought a book, Web Master in a Nutshell,
and started to dabble. When I found Dreamweaver 2 it appeared to make
better code, and let me be more creative whilst still letting me take
control of the code... haven't looked back since then, and have made a
nice living from it so far, always learning on the way.

Steve
Jul 25 '08 #17

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

Similar topics

0
2465
by: Spud | last post by:
<?php // pullpage function by Nick bouton http://www.nickbouton.com/. $CustomerID = "IDHERE"; $method = "POST"; $host = "xml.mydata.com"; $usepath = "/xml.asp"; //print all vars in an array
6
2225
by: Kingdom | last post by:
I'm using this script to dynamicaly populate 2 dropdowns and dispaly the results. Choose a component type from the first drop down, lets say 'car' and the second box will list all the car 'manufacturers' and the display will then provide all the rest of the info from the other fields. I need to eliminate all the duplicates in the First Drop Down as it currently displays an entry for every record, many are identical, I might have over...
20
10161
by: | last post by:
If I need to check if a certain value does exist in a field, and return either "yes" or "not" which query would be the most effestive?
2
2226
by: Jayjay | last post by:
When it comes to access, I'm pretty good using the built in features and can come up with some pretty complex functions to get what I need. But we have this database I'm doing for work that is trying to pull in too many things. The database is a construction job estimating program. First you setup a project, then you add items that will be needed for the job and you create a cost estimate. You then send this list out to construction...
5
4068
by: ED | last post by:
I currently have vba code that ranks employees based on their average job time ordered by their region, zone, and job code. I currently have vba code that will cycle through a query and ranks each employee based on their region, zone, job code and avg job time. (See code below). My problem is that I do not know how to rank the ties. Right now if two people have the same avg time one will be ranked 3rd and the other ranked 4th. I would...
10
1691
by: HK | last post by:
With VB.NET 2005, and a Windows Form, running on a dual CPU box, I need to take a recordset (e.g. 100,000 records) and spawn a thread to handle an internet XML transaction routine for each of the records. This is a nice use of threading because those internet requests are going against 3rd party servers that often have 1 second latency problems and so handling them with multiple threads is the fastest way to get through all the records in...
2
3046
by: barret bonden | last post by:
(closest newsgroup I could find) Error Type: ADODB.Recordset (0x800A0CB3) Current Recordset does not support updating. This may be a limitation of the provider, or of the selected locktype. /asp_data3_add.asp, line 30 <% 'Dimension variables Dim adoCon 'Holds the Database Connection Object
6
1417
by: doncee | last post by:
This is the set up: is a date field on a form. Its control source is the field "date_entered" in"Table1". If there is a date showing in the date_entered field (Text6) & the status in Combo box2 shows "deleted" then the after update event should delete the date in Text6 & return the field "date_entered to a null value when the form is closed. Even though the debug window shows rst!date entered as null when you step through this event...
6
3078
by: MrDeej | last post by:
Hello! I have code wich scans the through 10 computers on a LAN for files and import them into different tabels. This code aproximitly imports 10 000 files (with 1 to 20 rows of info) a day and is running looped (i have 'do' and 'loop' in the top and bottom of the code) and have to be started and stopped manually. Because i want the files to be imported almost instantly when they are created i let the code just loop and go through as fast...
0
9579
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10199
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10035
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8862
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7396
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
5293
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...
1
3948
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
2
3551
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2810
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.