-
using a wildcard in an if else statement
Hi,
In an ecommerce situation, when a category link is clicked, my results page shows the category name at the top of the page
This is working great apart from when a search is done without specifying category eg from the search page
So for example Results.asp?Category=%25&Keyword=&Submit=Search
This gives all products in the results page but just gives the last category name in the table as the heading
I would like to write a condition that just presents a static message eg ‘Results’ when the search wildcard % is passed
I have tried with
<% if rsCatName.Fields.Item("Category") = "%" then %> <h2>Results</h2>
<% else %>
<h2><%=(rsCatName.Fields.Item("Category").Value)%></h2>
<% end if %>
but this does not work
Can someone tell me how to do this correctly please
Thanks
ian
-
if instr(request.querystring("Category"),"%") > 0 then
the instr (in string) will tell you if the % is in the querystring variable...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Bookmarks