1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Adding Multiple Values

Discussion in 'C#' started by gooseandluba, Feb 18, 2009.

  1. #1
    Here is a snippet from my page.asp file.

    <TD><% If rstDBEdit.Fields("Title").Value = "NEWS" Then
    Response.Buffer = True
    Dim objXMLHTTP, xml
    url = rstDBEdit.Fields("Body").Value

    What I want to do is change the Value = "NEWS" to

    Value = "WORLD NEWS" or "LOCAL NEWS" or "SPORTS NEWS"

    The reason I need to do this is because the way the code is currently written, I have to name all my newly created pages "NEWS". This becomes very confusing when adding 10-20 new pages.

    All thoughts are welcomed!
     
    gooseandluba, Feb 18, 2009 IP
  2. gnp

    gnp Peon

    Messages:
    137
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #2
    that should be
    either
    
    tempTitle = rstDBEdit.Fields("Title").Value = "NEWS"
    if tempTitle = "WORLD NEWS" or tempTitle = "LOCAL NEWS" or tempTitle = "SPORTS NEWS" then 
     <your code here>
    end if
    
    Code (asp):
    or
    
    select case rstDBEdit.Fields("Title").Value = "NEWS"
     case "WORLD NEWS" , "LOCAL NEWS" , "SPORTS NEWS"
      <your code here>
    end select
    
    Code (asp):
    you could also just check if it ends in "NEWS" (but make sure that no titles end in NEWS if you do not want the to be parsed by this code..
    
    if right(rstDBEdit.Fields("Title").Value, 4) = "NEWS" then
     <your code here>
    end if
    
    Code (asp):
    take care
     
    gnp, Feb 19, 2009 IP
  3. gooseandluba

    gooseandluba Peon

    Messages:
    202
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I tried the first and second scenarios however neither seemed to work for me.

    Any other suggestions???
     
    gooseandluba, Feb 19, 2009 IP
  4. gnp

    gnp Peon

    Messages:
    137
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I am sorry,

    i made a mistake in the copy/paste of your code ( i did not remove the final = "NEWS" part )

    they should be:
    
    tempTitle = rstDBEdit.Fields("Title").Value
    if tempTitle = "WORLD NEWS" or tempTitle = "LOCAL NEWS" or tempTitle = "SPORTS NEWS" then 
     <your code here>
    end if
    
    Code (asp):
    or
    
    select case rstDBEdit.Fields("Title").Value
     case "WORLD NEWS" , "LOCAL NEWS" , "SPORTS NEWS"
      <your code here>
    end select
    
    Code (asp):
     
    gnp, Feb 19, 2009 IP
    gooseandluba likes this.
  5. gooseandluba

    gooseandluba Peon

    Messages:
    202
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #5
    You are the best! I didn't think I had a hope in Hell of getting this to work.

    Many thanks to you.
     
    gooseandluba, Feb 19, 2009 IP
  6. gnp

    gnp Peon

    Messages:
    137
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #6
    :)
    Glad it helped.

    There is a solution for everything ;)
     
    gnp, Feb 19, 2009 IP
  7. gooseandluba

    gooseandluba Peon

    Messages:
    202
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #7
    All right then... Let's try this.

    The pages that I am adding are newly created rss news feeds. Currently these pages are set up independently, meaning each rss feed has it's own dedicated page.

    Is there a way to add a news feed to a portion of a page that has other content on it such as the home page?
     
    gooseandluba, Feb 19, 2009 IP
  8. gnp

    gnp Peon

    Messages:
    137
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Can't see why not,

    logically you should be able to use the same code you use on your independent pages..

    ( my understanding is that you read a feed and display its contents.. right ? )
     
    gnp, Feb 19, 2009 IP
  9. gooseandluba

    gooseandluba Peon

    Messages:
    202
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Your understanding is correct! I will mess around with that code and see what I can come up with.

    Thanks again.
     
    gooseandluba, Feb 19, 2009 IP