only show pic if there is a record

Ask a Question related to Dreamweaver AppDev, Design and Development.

  1. #1

    Default only show pic if there is a record

    Ive got an asp website which has a news function. it pulls through info and a
    pic ref to a url on the server that in turn puts it onto a page.

    My problem is that i only want to show this picture if there is a record in
    that news item - at the moment its coming up as a broken picture link. Is there
    a way of showing it only if that record in the table is filled in?

    ive tried using the only show if... function but the record has info in it
    with the details of the news anyway, so it thinks there is info in it when
    picref if blank and the rest of the fields are filled in

    anyone shed some light on this for me?

    Mo*1 Guest

  2. Similar Questions and Discussions

    1. Show Record Horizontal
      In Macromedia Dreamweaver MX 2004 we can only show Record Vetical using repeat. But one of my compatible web developer in my company show 3 record...
    2. "Show If" server behavior for a single record
      Does anyone know if this is possible? For example... I have a record within a recordset that includes images, but if the field is empty I would...
    3. Show record based on time
      I have a record in a DB with a start time and a stop time (their data types are set to datetime). i want to show the record if the current time...
    4. How to show record in new form by clicking on name
      Hi All, I have a asp-build grid with some records. The name of a record is a {Link}. I want to be able to click on the link and open a new...
    5. Stop adding record in subform after record count = 1
      Can someone help in in what to put after the THEN statment to allow one entry if the Record count is =>1 in the Before insert or should I set the...
  3. #2

    Default Re: only show pic if there is a record

    you can try:

    If Not IsNull(picture_field) Then
    'Show info
    End If

    HTH,

    manuel

    Mo*1 wrote:
    > Ive got an asp website which has a news function. it pulls through info and a
    > pic ref to a url on the server that in turn puts it onto a page.
    >
    > My problem is that i only want to show this picture if there is a record in
    > that news item - at the moment its coming up as a broken picture link. Is there
    > a way of showing it only if that record in the table is filled in?
    >
    > ive tried using the only show if... function but the record has info in it
    > with the details of the news anyway, so it thinks there is info in it when
    > picref if blank and the rest of the fields are filled in
    >
    > anyone shed some light on this for me?
    >
    Manuel Socarras Guest

  4. #3

    Default Re: only show pic if there is a record

    unfortunatly it didnt work...ive got a hide if record is empty on the field,
    but cant figure out how to put in the also hide if that field is empty...ive
    put in the code you gave me but is this right? any help appreciated!

    <% If Not RS_newsp.EOF Or Not RS_newsp.BOF Then %>
    <% If Not IsNull("picref") Then %>
    <img src="<%=(RS_newsp.Fields.Item("picref").Value)%>" width="148"
    height="156">
    <% End If %>
    <% End If ' end Not RS_newsp.EOF Or NOT
    RS_newsp.BOF %>

    Mo*1 Guest

  5. #4

    Default Re: only show pic if there is a record

    correct this line:

    If Not IsNull(RS_newsp.Fields.Item("picref").Value) Then


    Mo*1 wrote:
    > unfortunatly it didnt work...ive got a hide if record is empty on the field,
    > but cant figure out how to put in the also hide if that field is empty...ive
    > put in the code you gave me but is this right? any help appreciated!
    >
    > <% If Not RS_newsp.EOF Or Not RS_newsp.BOF Then %>
    > <% If Not IsNull("picref") Then %>
    > <img src="<%=(RS_newsp.Fields.Item("picref").Value)%>" width="148"
    > height="156">
    > <% End If %>
    > <% End If ' end Not RS_newsp.EOF Or NOT
    > RS_newsp.BOF %>
    >
    Manuel Socarras 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