Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP General (http://www.velocityreviews.com/forums/f65-asp-general.html)
-   -   asp code does not render for first record in looped recordset (http://www.velocityreviews.com/forums/t804346-asp-code-does-not-render-for-first-record-in-looped-recordset.html)

haft@canchair.com 07-22-2008 08:02 PM

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,bigImage,header ) function call of discussion:

var currentImage;
function showBigImage( isource,bigImage,header ) {
var theImage = document.getElementById( 'largeimage' );
theImage.src = isource;
currentImage = bigImage;
document.getElementById( 'photoHeader' ).innerHTML=header;
document.getElementById( 'largeimage' ).alt=header;

The following rendered looped recordset code illustrates how the
"header" parameter of this showBigImage( isource,bigImage,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_img" onmouseover="showBigImage( 'imagescript.asp?
path=images/portable_stage.jpg&width=250','images/
portable_stage.jpg','' )"> <img src="imagescript.asp?path=images/
portable_stage.jpg&width=36" border="0" alt="" /> </td> </a>

<a href= "javascript:;" > <td height=36 valign="middle"
class="small_img" onmouseover="showBigImage( 'imagescript.asp?
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="imagescript.asp?path=images/seated_riserset.jpg&width=36"
border="0" alt="" /> </td> </a>

<a href= "javascript:;" > <td height=36 valign="middle"
class="small_img" onmouseover="showBigImage( 'imagescript.asp?
path=images/Stageset.jpg&width=250','images/Stageset.jpg','Portable
stage configuration using 16 units of the 4 ft x 8 ft platforms' )">
<img src="imagescript.asp?path=images/Stageset.jpg&width=36"
border="0" alt="" /> </td> </a>

<a href= "javascript:;" > <td height=36 valign="middle"
class="small_img" onmouseover="showBigImage( 'imagescript.asp?
path=images/Runset.jpg&width=250','images/Runset.jpg','Portable stage
runset configuration' )"> <img src="imagescript.asp?path=images/
Runset.jpg&width=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

Evertjan. 07-22-2008 08:14 PM

Re: asp code does not render for first record in looped recordset
 
wrote on 22 jul 2008 in microsoft.public.inetserver.asp.general:

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


There is no ASP code in the below.

> The following head section javascript code contains the function
> showBigImage( isource,bigImage,header ) function call of discussion:
>
> var currentImage;
> function showBigImage( isource,bigImage,header ) {
> var theImage = document.getElementById( 'largeimage' );
> theImage.src = isource;
> currentImage = bigImage;
> document.getElementById( 'photoHeader' ).innerHTML=header;
> document.getElementById( 'largeimage' ).alt=header;


This is clientside code, so you are off topic.

> The following rendered looped recordset code illustrates how the
> "header" parameter of this showBigImage( isource,bigImage,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_img" onmouseover="showBigImage( 'imagescript.asp?
> path=images/portable_stage.jpg&width=250','images/
> portable_stage.jpg','' )"> <img src="imagescript.asp?path=images/
> portable_stage.jpg&width=36" border="0" alt="" /> </td> </a>
>
> <a href= "javascript:;" > <td height=36 valign="middle"
> class="small_img" onmouseover="showBigImage( 'imagescript.asp?
> 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="imagescript.asp?path=images/seated_riserset.jpg&width=36"
> border="0" alt="" /> </td> </a>
>
> <a href= "javascript:;" > <td height=36 valign="middle"
> class="small_img" onmouseover="showBigImage( 'imagescript.asp?
> path=images/Stageset.jpg&width=250','images/Stageset.jpg','Portable
> stage configuration using 16 units of the 4 ft x 8 ft platforms' )">
> <img src="imagescript.asp?path=images/Stageset.jpg&width=36"
> border="0" alt="" /> </td> </a>
>
> <a href= "javascript:;" > <td height=36 valign="middle"
> class="small_img" onmouseover="showBigImage( 'imagescript.asp?
> path=images/Runset.jpg&width=250','images/Runset.jpg','Portable stage
> runset configuration' )"> <img src="imagescript.asp?path=images/
> Runset.jpg&width=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...tID=198&Produc
> tFamily=1&ProductFamilySub=10
>




--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

Bob Barrows [MVP] 07-22-2008 08:24 PM

Re: asp code does not render for first record in looped recordset
 
haft@canchair.com wrote:
> I have posted this question on a javascript forum as it contains
> javascript code however it was believed to be an asp issue.


Given that there is no server-side code shown here, I'm not sure what
led whoever it was to believe that this was an ASP issue.

If it is an asp issue then we have no chance of debugging it without
seeing the server-side code contained in ...imagescript.asp
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.



haft@canchair.com 07-23-2008 01:39 AM

Re: asp code does not render for first record in looped recordset
 
On Jul 22, 4:24*pm, "Bob Barrows [MVP]" <reb01...@NOyahoo.SPAMcom>
wrote:
> h...@canchair.com wrote:
> > I have posted this question on a javascript forum as it contains
> > javascript code however it was believed to be an asp issue.

>
> Given that there is no server-side code shown here, I'm not sure what
> led whoever it was to believe that this was an ASP issue.
>
> If it is an asp issue then we have no chance of debugging it without
> seeing the server-side code contained in ...imagescript.asp
> --
> Microsoft MVP -- ASP/ASP.NET
> Please reply to the newsgroup. The email account listed in my From
> header is my spam trap, so I don't check it very often. You will get a
> quicker response by posting to the newsgroup.


You are absolutely right. I should've posted the asp code and here it
is:

<a href= "javascript:;" class="small_img" >
<td height=36 valign="middle"
class="small_img" onmouseover="showBigImage( 'imagescript.asp?path=<%=
images.Fields.Item( "url_img" ).Value %>&width=250','<%=
images.Fields.Item( "url_img" ).Value %>','<
%=(images.Fields.Item("alt_img").Value)%>' )"><img
src="imagescript.asp?path=<%= images.Fields.Item( "url_img" ).Value
%>&width=36" border="0" alt="" /> </td>
</a>

Evertjan. 07-23-2008 08:06 AM

Re: asp code does not render for first record in looped recordset
 
wrote on 23 jul 2008 in microsoft.public.inetserver.asp.general:

> On Jul 22, 4:24*pm, "Bob Barrows [MVP]" <reb01...@NOyahoo.SPAMcom>
> wrote:
>> h...@canchair.com wrote:
>> > I have posted this question on a javascript forum as it contains
>> > javascript code however it was believed to be an asp issue.

>>
>> Given that there is no server-side code shown here, I'm not sure what
>> led whoever it was to believe that this was an ASP issue.
>>
>> If it is an asp issue then we have no chance of debugging it without
>> seeing the server-side code contained in ...imagescript.asp
>> --
>> Microsoft MVP -- ASP/ASP.NET
>> Please reply to the newsgroup. The email account listed in my From
>> header is my spam trap, so I don't check it very often. You will get
>> a quicker response by posting to the newsgroup.

>
> You are absolutely right. I should've posted the asp code and here it
> is:
>
> <a href= "javascript:;" class="small_img" >
> <td height=36 valign="middle"
> class="small_img" onmouseover="showBigImage(
> 'imagescript.asp?path=<%images.Fields.Item( "url_img" ).Value
> %>&width=250','<%images.Fields.Item( "url_img" ).Value %>','<
> %=(images.Fields.Item("alt_img").Value)%>' )"><img
> src="imagescript.asp?path=<%= images.Fields.Item( "url_img" ).Value
> %>&width=36" border="0" alt="" /> </td>
> </a>
>


If the ASP string is correct, even then this:

<%images.Fields.Item( "url_img" ).Value %>

will not do in ASP, or render to the html-string, anything,
so perhaps you want to try:

<% = images.Fields.Item( "url_img" ).Value %>

[etc.]

However,
since you do not show the relevant serverside database access code,
or even what database you use,
I cannot say.

And we do not know if imagescript.asp will process the querystring value
correctly

And if the resultstring of
<% = images.Fields.Item( "url_img" ).Value %>
is encoded to precvent it to have characters that break the querystring,
[like an apostrophe].

Even the html is wrong:
<td .... /></td>
[why the /> ?]
and
<a ...><td .... /></td>...</a>
is wrong,
and
<a href= "javascript:;" class="small_img" >
is questionable,
but that all is off topic on this NG.


--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

Bob Barrows [MVP] 07-23-2008 10:40 AM

Re: asp code does not render for first record in looped recordset
 
haft@canchair.com wrote:
> On Jul 22, 4:24 pm, "Bob Barrows [MVP]" <reb01...@NOyahoo.SPAMcom>
> wrote:
>> h...@canchair.com wrote:
>>> I have posted this question on a javascript forum as it contains
>>> javascript code however it was believed to be an asp issue.

>>
>> Given that there is no server-side code shown here, I'm not sure what
>> led whoever it was to believe that this was an ASP issue.
>>
>> If it is an asp issue then we have no chance of debugging it without
>> seeing the server-side code contained in ...imagescript.asp

>
> You are absolutely right. I should've posted the asp code and here it
> is:
>
> <a href= "javascript:;" class="small_img" >
> <td height=36 valign="middle"
> class="small_img" onmouseover="showBigImage( 'imagescript.asp?path=<%=
> images.Fields.Item( "url_img" ).Value %>&width=250','<%=
> images.Fields.Item( "url_img" ).Value %>','<
> %=(images.Fields.Item("alt_img").Value)%>' )"><img
> src="imagescript.asp?path=<%= images.Fields.Item( "url_img" ).Value
> %>&width=36" border="0" alt="" /> </td>
> </a>


Err ... that is not the code contained in imagescript.asp is it? No mention
of a recordset, for one thing ...

--
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"



haft@canchair.com 07-23-2008 02:35 PM

Re: asp code does not render for first record in looped recordset
 
i really appreciate the responses.


the imagescript page is the page that resizes the images but i have no
issues with the images but rather the alt_img database field not
rendering properly for the initial recordset value.

and database type is Access.


imagescript.asp code:

<%


Response.Expires = 0
' create instance of AspJpeg
Set Jpeg = Server.CreateObject("Persits.Jpeg")

If Request.QueryString("width")=36 Then
Jpeg.New 36, 36, &HFFFFFF
Else
Jpeg.New 250, 250, &HFFFFFF
End If

' Open source file
Jpeg.Open Server.MapPath(Request.QueryString("path"))

'Jpeg.Width = Request("Width")

L = Request("Width")

'Jpeg.Height = Jpeg.OriginalHeight * Jpeg.Width / Jpeg.OriginalWidth

If jpeg.OriginalWidth > jpeg.OriginalHeight Then
jpeg.Width = L
jpeg.Height = jpeg.OriginalHeight * L / jpeg.OriginalWidth
Else
jpeg.Height = L
jpeg.Width = jpeg.OriginalWidth * L / jpeg.OriginalHeight
End If

' Perform resizing and
' send resultant image to client browser
Jpeg.SendBinary

%>

haft@canchair.com 07-23-2008 02:45 PM

Re: asp code does not render for first record in looped recordset
 
This is the code to narrow in on:

onmouseover="showBigImage( 'imagescript.asp?path=<%=
images.Fields.Item( "url_img" ).Value %>&width=250','<%=
images.Fields.Item( "url_img" ).Value %>','<
%=(images.Fields.Item("alt_img").Value)%>' )">

This '<%=(images.Fields.Item("alt_img").Value)%>' portion of the code
is what is not rendering for the initial image of the recordset

Bob Barrows [MVP] 07-23-2008 02:50 PM

Re: asp code does not render for first record in looped recordset
 
haft@canchair.com wrote:
> i really appreciate the responses.
>
>
> the imagescript page is the page that resizes the images but i have no
> issues with the images but rather the alt_img database field not
> rendering properly for the initial recordset value.


So I guess I still don't understand the suspicion that this is an
ASP/server-side code problem.

>
> and database type is Access.
>
>
> imagescript.asp code:
>

<snip>
Still no mention of a recordset ... ?
I don't know how we can help.

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.



Bob Barrows [MVP] 07-23-2008 02:54 PM

Re: asp code does not render for first record in looped recordset
 
haft@canchair.com wrote:
> This is the code to narrow in on:
>
> onmouseover="showBigImage( 'imagescript.asp?path=<%=
> images.Fields.Item( "url_img" ).Value %>&width=250','<%=
> images.Fields.Item( "url_img" ).Value %>','<
> %=(images.Fields.Item("alt_img").Value)%>' )">
>
> This '<%=(images.Fields.Item("alt_img").Value)%>' portion of the code
> is what is not rendering for the initial image of the recordset


No it isn't. There is no mention of a recordset here, unless images is a
recordset object. If so, we need to see the code used to open the
recordset (and its connection) as well as a description of the database
table (field datatypes and names), along with the code used to navigate
to the record whose alt_img field you wish to display. Try to slice out
as much html as possible so we can focus on the server-side ADO code.


--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.




All times are GMT. The time now is 08:12 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.