Response.Writing Rows based on If Staments

Ask a Question related to ASP, Design and Development.

  1. #1

    Default Response.Writing Rows based on If Staments

    Hi All,

    been away from developing, if you can call what I do that, and am stumped
    already..lol..see code below. I'm trying to get each row to display, based
    on the if statements. Hope you can help me here. Cheers.

    P.S. ? will appear in place of Japanese characters. Thanx for your
    understanding.

    Mark Sargent.

    Error Type:
    Microsoft VBScript compilation (0x800A0400)
    Expected statement
    /Classifieds/UploadScript.asp, line 63
    <td>File Type Error</td>

    .................................................. .........................
    Error code is identified here
    .................................................. .........................



    <table align="center" bgcolor="#00FF00">
    <tr>
    <td width="55%">
    <p align="center"><br>
    <%
    Dim strPath
    strPath = "/Classifieds/ImageUploads"
    Set Upload = Server.CreateObject("Persits.Upload")
    Upload.OverwriteFiles = False
    Count = Upload.SaveVirtual(strPath)
    If Err <> 0 Then
    Response.write ("Err.Description")
    End if
    For Each File in Upload.Files
    If File.ImageType <> "JPG" Then
    WrongFileType = "????.jpeg??????????????????????????????"
    File.Delete
    End If
    If File.Size > 50000 Then
    FileTooBig = "????????????50000??????????(" &File.Size&"bytes).
    ?????????????????????????????."
    File.Delete
    End If
    Next
    Dim ImageWidth
    Dim ImageHeight
    Dim FilePath
    For Each File in Upload.Files
    FilePath = File.Path
    ImageWidth = File.ImageWidth
    ImageHeight = File.ImageHeight
    Next
    FilePath = replace(FilePath, "\", "/")
    FilePath = replace(FilePath, "RemovedForSecurity", "")
    %>
    </td>
    </tr>

    <tr> <%If WrongFileType <> "" Then
    .................................................. ...........................
    .................................................. ...........................
    .................................................. ........
    <td>File Type Error</td>
    .................................................. ...........................
    .................................................. ...........................
    .................................................. .........
    <td>Response.Write WrongFileType &"<br>" %>
    <a href="ClassifiedUploadImage.asp"><font color="#000000"><b>Try
    Again</b></font></a>

    <td width="55%"></td>

    <%
    ElseIf FileTooBig <> "" Then
    <td>File Too Big</td>
    <td>Response.Write "<font face=""MS P????, MS P??, MS UI Gothic,
    MS ????, MS ??"">" &FileTooBig &"</font><br>"%>
    <a href="ClassifiedUploadImage.asp"><font color="#000000"><b>Try
    Again</b></font></a>
    <td width="45%"></td>
    </tr>

    <%
    Else
    For Each File in Upload.Files
    <tr>
    <td>File Name</td>
    <td> Response.Write File.FileName & "(" & File.Size & "bytes)
    uploaded to easyboarder. <BR>"</td></tr>
    Next
    <tr>
    <td>Image Width</td>
    <td>Response.Write "Image Width:"&ImageWidth &"<br>"</td>
    <tr>
    <td>Image Height</td>
    <td>Response.Write "Image Height:"&ImageHeight &"<br>"%>
    <td width="55%"></td>

    <tr>

    <td width="55%"> <font color="#FFFFFF" size="2" face="MS P????, MS P??,
    MS UI Gothic, MS ????, MS ??"><b>????????????????????????????????</b></font>
    <td width="45%"><font color="#FFFFFF" size="2" face="MS P????, MS P??,
    MS UI Gothic, MS ????, MS ??"><b><a
    href="ClassifiedImageResize.asp?FilePath=<%=FilePa th%>"><font
    color="#000000"><b>Resize
    Image</b></font></a></b></font>
    <p align="center"><font color="#FFFFFF" size="2" face="MS P????, MS
    P??, MS UI Gothic, MS ????, MS ??"><b>
    </b></font>
    <p align="center">
    <p align="center"></td>
    <form name="form2" method="post" action="ClassifiedNewDetails.asp">
    <input type="submit" name="Submit" value="Continue">
    <br>
    <input type="hidden" name="FilePath" value="<%= FilePath%>">
    <br>
    <input type="hidden" name="hiddenField2" value="<%=
    Session("MM_Username")%>">
    <%
    End If
    %>
    </form>
    </tr>
    </table>


    Mark Sargent Guest

  2. Similar Questions and Discussions

    1. HTTP 1.1 based request / response
      How to send / receive HTTP 1.1 based request / response to create a persistent connection with web server (Jsp in Tomcat)?
    2. selecting based on matches on multiple rows?
      I thought this would be simple, but it has me stumped. I've got items that have attributes. Attributes are of the form "name=value", where "name"...
    3. rows in a datagrid in bold based on the value of a field
      How can I make some rows (of a datagrid) in bold based on the value of a field? for instance if that field is "1" row should be in bold ,otherwise...
    4. writing db record to tables (wrapping and spanning rows)
      Hi, I have a dataset where each record contains a persons name and filename of their picture. I want to write a row of five names, then a row...
    5. HELP: writing a file to response buffer --> IE shows wrong filename
      Hi In an .aspx codebehind file I retrieve a file from a database and write it to the response buffer, so the browser pops up a 'save file' dialog...
  3. #2

    Default Re: Response.Writing Rows based on If Staments


    "Mark Sargent" <downdogWoof@hotmail.com> wrote in message
    news:u5MKo2TmDHA.3312@tk2msftngp13.phx.gbl...
    > Hi All,
    >
    > been away from developing, if you can call what I do that, and am stumped
    > already..lol..see code below. I'm trying to get each row to display, based
    > on the if statements. Hope you can help me here. Cheers.
    >
    Are you getting an error? What are you trying to do that's not happening?
    The code you posted had "if this then response.write that end if" in various
    places. So, what's the issue?

    Ray at work


    Ray at Guest

  4. #3

    Default Re: Response.Writing Rows based on If Staments

    dunno..pretty drunk at the mo..perhaps I'm the problem...lol...thought I
    posted the actual error...shit, perhaps I need another cold one,
    eh..cheers..

    Mark, I'm pretty drunk, Sargent...


    Mark Sargent Guest

  5. #4

    Default Re: Response.Writing Rows based on If Staments

    Okay

    "Mark Sargent" <downdogWoof@hotmail.com> wrote in message
    news:uai4J2XmDHA.3700@TK2MSFTNGP11.phx.gbl...
    > dunno..pretty drunk at the mo..perhaps I'm the problem...lol...thought I
    > posted the actual error...shit, perhaps I need another cold one,
    > eh..cheers..
    >
    > Mark, I'm pretty drunk, Sargent...
    >
    >

    Ray at Guest

  6. #5

    Default Re: Response.Writing Rows based on If Staments

    ooops, drunk or not drunk, excuse my colorful language...be back
    tomorow....cheers...

    Mark, still drunk, Sargent,...


    Mark Sargent Guest

  7. #6

    Default Re: Response.Writing Rows based on If Staments

    okay, now that I'm sober..damn the Rugby World Cup...what I was attempting
    to do, was, have a row appear when a condition was met, but, got the
    following error,

    Error Type:
    Microsoft VBScript compilation (0x800A0400)
    Expected statement
    /Classifieds/UploadScript.asp, line 63
    <td>File Type Error</td>

    I don't understand it. Cheers.

    Mark Sargent.


    Mark Sargent Guest

  8. #7

    Default Re: Response.Writing Rows based on If Staments

    figured it out..just had to put the <tr> tags before the <%> tags..cheers..

    Mark Sargent.


    Mark Sargent Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139