|
| |
|
|
octavious
Posts: 66 Joined: 2/10/2005 From: Northern California Status: offline
|
Help with ImageResize function - 4/12/2008 11:50:39
Im using the ImageResize function to display images uploaded by users to a specific dimension. However, I went one step further providing them an option to display the image in its original size or the specs applied by the ImageResize. My problem is that I cant seem to find the correct format to make this function work within an IF.. THEN statement. This is my statement to simply apply the ImageResize:
<img border="0" src="../photos/<%=ImageName%>"<%=ImageResize(Server.MapPath("../photos/" & <%=ImageName%>),55,65)%> alt="<%=ImgTitle%>">
This is my IF.. THEN statement that I cant seem to format or get to work properly: <%
IF XDSPFORMAT=2 THEN
RESPONSE.WRITE "<img border='0' src='../photos/"&XIMAGENAME&"'> "
ELSE IF XDSPFORMAT=1 THEN
RESPONSE.WRITE "<img border='0' src='../photos/"&XIMAGENAME&" ' "&ImageResize(Server.MapPath('../photos/' & "&XIMAGENAME&" ),525,525)&" > "
END IF
%> The first statement (XDSPFORMAT=2 ) works fine, but the second statement is not working for me. I'm sure it's just some type of formatting error. This is the error I get: Microsoft VBScript compilation error '800a03ea' Syntax error editphoto.asp, line 226 RESPONSE.WRITE "<img border='0' src='../photos/"&XIMAGENAME&"' "&ImageResize(Server.MapPath('../photos/' & "&XIMAGENAME&" ),525,525)&" > " --------------------------------------------------------------------------------------------^ I have tried several different variations of the quotes and ampersands and cant seem to get this function to work within an ASP statement. Any help would be greatly appreciated!! Thanks, O:)
|
|
|
|
rdouglass
Posts: 9167 From: Biddeford, ME USA Status: offline
|
RE: Help with ImageResize function - 4/12/2008 12:16:04
quote:
"&ImageResize(Server.MapPath('../photos/' & "&XIMAGENAME&" ),525,525)&" Hiw 'bout this? ..."&ImageResize(Server.MapPath("../photos/" & XIMAGENAME ),525,525)&"... That any better?
_____________________________
Don't take you're eye off your final destination. ASP Checkbox Function Tutorial.
|
|
|
|
octavious
Posts: 66 Joined: 2/10/2005 From: Northern California Status: offline
|
RE: Help with ImageResize function - 4/12/2008 13:54:24
Awesome dude! Just for those that may want to use this, here is the final code. I actually needed to place it all in one line as well: <% IF XDSPFORMAT=2 THEN RESPONSE.WRITE "<img border='0' src='../photos/"&XIMAGENAME&"'> " ELSE IF XDSPFORMAT=1 THEN RESPONSE.WRITE "<img border='0' src='../photos/"&XIMAGENAME&" ' "&ImageResize(Server.MapPath("../photos/" & XIMAGENAME ),525,525)&" > " END IF %> Thanks again..... O:)
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|