Newbie question about menu bar

Discussion in 'ASP General' started by Martien van Wanrooij, Feb 15, 2004.

  1. I am rather new to asp and tried the following script in order to create a
    list of menu items where the item referring to the current page should not
    be act like a link.

    <%
    sub maakSubLinkWaarNodig (strUrl, strOmschrijving)
    strDezePagina = Request.ServerVariables("SCRIPT_NAME")
    if instr(strDezePagina, strUrl) > 1 then
    response.write "<span class = currentPage>"& strOmschrijving &
    "</span><br><br>"
    else
    response.write "<a href =" & strUrl & ">" & strOmschrijving &
    "</a><br><br>"
    end if
    end sub
    %>


    Its behaviour is a little bit unpredictable. I am trying in at
    www.cbsreizen.nl/test but it seems to work only on the pages related con
    "Roses" .
    I also tried the instr function with larger then zero, same result. When I
    add for testing purposes response.write strDezePagina, the correct page
    including a part of the path is represented.
    A second question: is it possible to retrieve only the name of the document
    itself _without_ the path, it can be done in php but I couldn't find a
    similar ASP function.
    Thanks for any comment.

    Martien van Wanrooij
     
    Martien van Wanrooij, Feb 15, 2004
    #1
    1. Advertising

  2. hi, i don't know if this can help you, but try make a download of aascripter
    in http://www.aascripter.com because you can construct a lot of menus with
    it.
    bye
    --



    ««««««««»»»»»»»»»»»»»»
    Vlmar Brazão de Oliveira
    Desenvolvimento Web
    HI-TEC
    "Martien van Wanrooij" <> escreveu na mensagem
    news:NyNXb.347$EV2.2908@amstwist00...
    > I am rather new to asp and tried the following script in order to create a
    > list of menu items where the item referring to the current page should not
    > be act like a link.
    >
    > <%
    > sub maakSubLinkWaarNodig (strUrl, strOmschrijving)
    > strDezePagina = Request.ServerVariables("SCRIPT_NAME")
    > if instr(strDezePagina, strUrl) > 1 then
    > response.write "<span class = currentPage>"& strOmschrijving &
    > "</span><br><br>"
    > else
    > response.write "<a href =" & strUrl & ">" & strOmschrijving &
    > "</a><br><br>"
    > end if
    > end sub
    > %>
    >
    >
    > Its behaviour is a little bit unpredictable. I am trying in at
    > www.cbsreizen.nl/test but it seems to work only on the pages related con
    > "Roses" .
    > I also tried the instr function with larger then zero, same result. When I
    > add for testing purposes response.write strDezePagina, the correct page
    > including a part of the path is represented.
    > A second question: is it possible to retrieve only the name of the

    document
    > itself _without_ the path, it can be done in php but I couldn't find a
    > similar ASP function.
    > Thanks for any comment.
    >
    > Martien van Wanrooij
    >
    >
     
    Vilmar Brazão de Oliveira, Feb 16, 2004
    #2
    1. Advertising

  3. Vilmar and Peter, thank you both for your help, but I found the reason for
    the error and I must have been sleeping the other day :)
    Well, I noticed that for the required document name parameter in some cases
    by mistake I started with a space after the first. quotation mark so instead
    of maakSublinkWaarNodig "mypage.html","go to my page"
    I wrote " mypage.html" , "go to my page".
    Obviously a statement like <a href = " mypage.html"> works in spite of the
    initial space and of course the string searching fails...
    Sorry for the incovenience, I thought it was fair to tell you the result...

    Martien.
     
    Martien van Wanrooij, Feb 16, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Matt
    Replies:
    0
    Views:
    3,551
  2. John Hann
    Replies:
    0
    Views:
    6,085
    John Hann
    Aug 21, 2004
  3. Matt
    Replies:
    9
    Views:
    70,863
  4. Matt
    Replies:
    9
    Views:
    550
    kaeli
    Aug 23, 2004
  5. Tim
    Replies:
    1
    Views:
    296
    Grant Wagner
    Jan 18, 2005
Loading...

Share This Page