[Javascript] Can't create <IMG> with ASP...very strange.

Rui Fortes ruifortes at clix.pt
Sat May 5 21:08:25 CDT 2001


Hello

I'm trying to create a table with pictures with asp.
The images source file name is stored in a database.
I'm constructing a string like this in vbscript:

    myImgStr = "<img src = images/" & myRecSet(0) & ".gif >"

and then I just use a "response.write(myImgStr)" inside a cell.

The problem is that I just get the red X in the cells.

If I try:

    myImgStr = "<img src = images/" & "myimage.gif" & ".gif >"

it works fine.

Also if I compare two string created like this:

    myImgStr1 = "images/" & myRecSet(0) & ".gif"
    myImgStr2 = "images/" & "myimage.gif" & ".gif"

    Response.write("<P>" & myImgStr1 & </P>")
    Response.write("<P>" & myImgStr2 & </P>")

the strings are identical.

I even tested them like this:

if myImgStr1 = myImgStr2 then Response.write("<P>Ok</P>")


Whats happening? Why can't I use the recorset field in the string
concatenation?

Please help me because this is driving me crazy!

Thanks








More information about the Javascript mailing list