Copy link to clipboard
Copied
Basically Im trying to show different code if the value in the DB in column Format is "View" or "Download" in bold is what I did my I'm thinking the code is wrong. I made one recordset named Umm. Any help is appreciated.
<table class="sortable" id="sortabletable" width="900" border="0" cellpadding="0" cellspacing="0">
<tr>
<th width="260">Division</th>
<th width="226">Title</th>
<th width="108">Format</th>
<th width="148">Language</th>
</tr>
<% While ((Repeat2__numRows <> 0) AND (NOT Umm.EOF)) %>
<tr>
<td><%=(Umm.Fields.Item("Division").Value)%></td>
<td><%=(Umm.Fields.Item("Title").Value)%></td>
<% if (Request.QueryString("Format")) = "Download" then %>
<td><a href="<%=(Umm.Fields.Item("URL").Value)%>"><%=(Umm.Fields.Item("Format").Value)%></a></td>
<%elseif (Request.QueryString("Format")) = "View" then%>
<td><a href="javascript:;" onclick="MM_openBrWindow('<%=(Umm.Fields.Item("URL").Value)%>','','toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=800,height=600')"><%=(Umm.Fields.Item("Format").Value)%></a></td>
<% end if %>
<td><%=(Umm.Fields.Item("Language").Value)%></td>
</tr>
<%
Repeat2__index=Repeat2__index+1
Repeat2__numRows=Repeat2__numRows-1
Umm.MoveNext()
Wend
%>
</table>
QueryString is used to get the querystring in the url. You want to compare a value in the database column:
<% if Umm.Fields.Item("Format").Value = "Download" then %>
etc.....
Copy link to clipboard
Copied
Is there a problem? What are the symptoms? I see a possible typo with a space character in "Format" but not sure if this is just a cut and paste issue in your post. There could be other problems but it's hard to tell when we don't know what problem you are experiencing.
<td><a href="<%=(Umm.Fields.Item("URL").Value)%>"><%=(Umm.Fields.Item("Forma t").Value)%></a></td>
Copy link to clipboard
Copied
The problem is the HTML is not written for either IF or Else If. How does Request Query know where to get the information from?
Copy link to clipboard
Copied
Request Query? Do you mean Request.QueryString? It gets the name/value pair from the querystring collection. Can you give us an example of what your url/querystring looks like?
Is your condition based on a querystring value or a database value?
Copy link to clipboard
Copied
No not a query string value just a DB value.
Copy link to clipboard
Copied
I created the recordset and need all columns, but if the Format column has a value of View
I want certain HTML written:
<% if (Request.QueryString("Format")) = "Download" then %>
<td><a href="<%=(Umm.Fields.Item("URL").Value)%>"><%=(Umm.Fields.Item("Format").Value)%></a></td>
<%elseif (Request.QueryString("Format")) = "View" then%>
<td><a href="javascript:;" onclick="MM_openBrWindow('<%=(Umm.Fields.Item("URL").Value)%>','','toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=800,height=600')"><%=(Umm.Fields.Item("Format").Value)%></a></td>
What do I need to use instead of Request.QueryString? Hmm I will research.
Copy link to clipboard
Copied
QueryString is used to get the querystring in the url. You want to compare a value in the database column:
<% if Umm.Fields.Item("Format").Value = "Download" then %>
etc.....
Copy link to clipboard
Copied
Thank you very much!