473,396 Members | 2,115 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Keeping Navigation Current by passing printing variables from url

I would like to pass a variable from a url and print that variable on the page. here is my code so far which isn't working:

Expand|Select|Wrap|Line Numbers
  1.  
  2. <% dim page %>
  3. <div id="globalNav">
  4.   <ul id="globalNavList">
  5.     <li <% page = Request.QueryString("home")
  6.     if page=home then Response.Write("class=home") end if %>><a href="/default.asp?page=home">home</a></li>
  7.     <li <% page = Request.QueryString("products")
  8.     if page=products then Response.Write("class=products") end if %>><a href="/products/default.asp?page=products">products</a></li>
  9.     <li><a href="/services/">services</a></li>
  10.     <li><a href="/clients/">clients</a></li>
  11.     <li><a href="/partners/">partners</a></li>
  12.     <li><a href="/about/">about us</a></li>
  13.   </ul>
  14. </div><!--/globalNav-->
  15. <div id="banner"></div><!--/banner-->
  16.  
  17.  
Dec 6 '06 #1
3 2174
sashi
1,754 Expert 1GB
I would like to pass a variable from a url and print that variable on the page. here is my code so far which isn't working:

Expand|Select|Wrap|Line Numbers
  1.  
  2. <% dim page %>
  3. <div id="globalNav">
  4.   <ul id="globalNavList">
  5.     <li <% page = Request.QueryString("home")
  6.     if page=home then Response.Write("class=home") end if %>><a href="/default.asp?page=home">home</a></li>
  7.     <li <% page = Request.QueryString("products")
  8.     if page=products then Response.Write("class=products") end if %>><a href="/products/default.asp?page=products">products</a></li>
  9.     <li><a href="/services/">services</a></li>
  10.     <li><a href="/clients/">clients</a></li>
  11.     <li><a href="/partners/">partners</a></li>
  12.     <li><a href="/about/">about us</a></li>
  13.   </ul>
  14. </div><!--/globalNav-->
  15. <div id="banner"></div><!--/banner-->
  16.  
  17.  
Hi there,

Kindly refer to below modified code segment, hope it works now. Good luck & Take care.

Expand|Select|Wrap|Line Numbers
  1. <% dim page %>
  2. <div id="globalNav">
  3.   <ul id="globalNavList">
  4.  
  5.     <li> 
  6.       <% if Request.QueryString("home") = Trim("home") then Response.Write("class=home") end if %>
  7.       <a href="/default.asp?page=home">home</a>
  8.     </li>
  9.  
  10.     <li> 
  11.       <% if Request.QueryString("products") = Trim("products") then Response.Write("class=products") end if %>
  12.       <a href="/products/default.asp?page=products">products</a>
  13.     </li>
  14.  
  15.     <li><a href="/services/">services</a></li>
  16.     <li><a href="/clients/">clients</a></li>
  17.     <li><a href="/partners/">partners</a></li>
  18.     <li><a href="/about/">about us</a></li>
  19.   </ul>
  20. </div>
  21. <!--/globalNav-->
  22.  
Dec 7 '06 #2
Hi there,

Kindly refer to below modified code segment, hope it works now. Good luck & Take care.

Expand|Select|Wrap|Line Numbers
  1. <% dim page %>
  2. <div id="globalNav">
  3.   <ul id="globalNavList">
  4.  
  5.     <li> 
  6.       <% if Request.QueryString("home") = Trim("home") then Response.Write("class=home") end if %>
  7.       <a href="/default.asp?page=home">home</a>
  8.     </li>
  9.  
  10.     <li> 
  11.       <% if Request.QueryString("products") = Trim("products") then Response.Write("class=products") end if %>
  12.       <a href="/products/default.asp?page=products">products</a>
  13.     </li>
  14.  
  15.     <li><a href="/services/">services</a></li>
  16.     <li><a href="/clients/">clients</a></li>
  17.     <li><a href="/partners/">partners</a></li>
  18.     <li><a href="/about/">about us</a></li>
  19.   </ul>
  20. </div>
  21. <!--/globalNav-->
  22.  

Hi, I think this would shed some light on what I'm trying to accomplish. This is the php version: http://alistapart.com/articles/keepingcurrent/

I bascially want to pass a variable using a url and have a page catch that variable and print out an html class to assign my global navigation list. I'll then have css style how the list element should render.

Bryan
Dec 7 '06 #3
Hi, I think this would shed some light on what I'm trying to accomplish. This is the php version: http://alistapart.com/articles/keepingcurrent/

I bascially want to pass a variable using a url and have a page catch that variable and print out an html class to assign my global navigation list. I'll then have css style how the list element should render.

Bryan
Hi again,

you can scratch my last post. I actually got it working with modification you posted. thanks!
Dec 7 '06 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: ebobnar | last post by:
I'm having trouble navigating my directory structure using php's ftp functions (such as ftp_chdir and ftp_cdup.) I'm writing a program that allows a user to easily create robot.txt files and upload...
2
by: nephish | last post by:
Hey there, i have been spending some time learning python. i do enjoy it so. Heres the deal. i need some dirrection advice. i have a friend that wants me to set up a customer database for him....
1
by: divya | last post by:
This is the problem I am having: I have an index page where I obtain input from the user (for example their date of birth). This information is passed to Page2. Page2 has frames. Outside of the...
179
by: SoloCDM | last post by:
How do I keep my entire web page at a fixed width? ********************************************************************* Signed, SoloCDM
0
by: Brian | last post by:
Thanks for your time. I'm interested in building a collapseable/multi-level/Xml based navigation control from scratch. My goal is something similar to Telerik's rad...
0
by: Dave Alvarado | last post by:
I'm working on some code that gathers data from a web interface to one of our servers (classic ASP). The problem is that the site uses session variables to store login information, so to move from...
2
by: Ray Booysen | last post by:
Hi all I have a question. I have a library in my webapp (1.1) that requires access to certain application cache and session variables. At the moment, I have been passing these in as parameters...
10
by: EA | last post by:
I am sure I must be missing something about building navigation bars with CSS. Yes it is a very clever and efficient way to format navigation structures on simple one navigation level webs, i.e....
1
by: quartzy | last post by:
I have a strict doc type: However, I am still unsure about css. Problems I have now are to do with floating both navigation lists. I have used tables and divs, as layouts are just too difficult for...
0
by: emalcolm_FLA | last post by:
Hello and TIA for your consideration. I have created several db's for a non-profit and they want custom navigation buttons to display "You are on the first record, last record, etc". With this...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.