SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Addict
    Join Date
    Jul 2009
    Posts
    352
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    New to asp, hopefully an easy question. Populating ProductID in include file

    I will try to make this short and sweet.

    When someone clicks on a link as such below

    http://winchester.linkstaging.com/pr...&CategoryID=22

    I would like a header file to pull an asp file corresponding to the ProductID (for seo meta tag purposes, so I can have a different header for each product). I am creating header files corresponding to the ProductID (76.asp)

    I tried using this line of code in the header of product_details.asp with no luck.

    Code:
    <!-- #include file="../common/includes/<&#37; response.write(strProductID) %>.asp" -->
    Is there anyways to get this to propagate the way I am envisioning?

    Thanks so much!

  2. #2
    Chopped Liver bronze trophy imaginekitty's Avatar
    Join Date
    Aug 2007
    Location
    Pennsyltucky
    Posts
    1,494
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    This is the .NET forum. Looks like you want Classic ASP.

  3. #3
    Just Blow It bronze trophy
    DaveMaxwell's Avatar
    Join Date
    Nov 1999
    Location
    Mechanicsburg, PA
    Posts
    7,254
    Mentioned
    113 Post(s)
    Tagged
    1 Thread(s)
    (moved to the appropriate forum)

    No, what you want to do is not possible because the includes are processed before any other processing occurs.

    If your product line is stable, you could do something like this in an include (so you'd only have one file to maintain...)

    Code ASP:
    <% select case strProductID 
     case 1 %>
     <meta name="keywords" content=" product1keyword1, product1keyword2, ...." />
     <meta name="description" content=" product1description" />
    <% case 2 %> 
     <meta name="keywords" content=" product2keyword1, product2keyword2, ...." />
     <meta name="description" content=" product2description" />
    <% case 3 %> 
     <meta name="keywords" content=" product3keyword1, product3keyword2, ...." />
     <meta name="description" content=" product3description" />
    <% end select %>

    Though a (much) better choice would be to store the meta information in the database with the rest of the product information. Then you could do a simple query and build the meta tags from the product table.
    Dave Maxwell - Manage Your Site Team Leader
    My favorite YouTube Video! | Star Wars, Dr Suess Style

  4. #4
    SitePoint Addict itHighway's Avatar
    Join Date
    Jan 2008
    Location
    GUJ
    Posts
    270
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Use if then else statement.


Bookmarks

Posting Permissions

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