Newbie question about menu bar

  • Thread starter Martien van Wanrooij
  • Start date
M

Martien van Wanrooij

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
 
V

Vilmar Brazão de Oliveira

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
 
M

Martien van Wanrooij

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top