need coding for menu bar

Please support our ASP.NET advertiser: 50% Off 6 Months Web Hosting from 1&1. The World's #1 Host!
Reply

Join Date: May 2009
Posts: 75
Reputation: mshravs is an unknown quantity at this point 
Solved Threads: 1
mshravs mshravs is offline Offline
Junior Poster in Training

need coding for menu bar

 
0
  #1
Jun 3rd, 2009
hey, i created a menu bar containing three items in it. i just want the coding in vb in such a way that if i click the first one it should be directed to one form, second is directed to the other form and third in the same way................................................................................... i'm using asp.net-3.5
Last edited by mshravs; Jun 3rd, 2009 at 1:13 am.
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 185
Reputation: aashishn86 is an unknown quantity at this point 
Solved Threads: 9
aashishn86's Avatar
aashishn86 aashishn86 is offline Offline
Junior Poster

Re: need coding for menu bar

 
0
  #2
Jun 3rd, 2009
you can use javascript....

on click of a option
redirect it using
  1. window.location="link"

if you need more help , please post back...i'll write an example...
hope it helps...
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 185
Reputation: aashishn86 is an unknown quantity at this point 
Solved Threads: 9
aashishn86's Avatar
aashishn86 aashishn86 is offline Offline
Junior Poster

Re: need coding for menu bar

 
0
  #3
Jun 3rd, 2009
here's the code

  1.  
  2. <html>
  3. <head>
  4. <script type="text/javascript" language="javascript">
  5.  
  6. function display(obj,id1,id2,id3)
  7. {
  8.  
  9. txt=obj.options[obj.selectedIndex].text;
  10. //alert(txt)
  11.  
  12. if(txt.match(id1))
  13. {
  14. window.location="a.html"
  15. }
  16.  
  17. if(txt.match(id2))
  18. {
  19. window.location="b.html"
  20. }
  21.  
  22. if(txt.match(id3))
  23. {
  24. window.location="c.html"
  25. }
  26.  
  27. }
  28. </script>
  29. </head>
  30.  
  31.  
  32. <body>
  33. <select id="type" onChange="display(this,'one','two','three');" >
  34. <option value="">select</option>
  35. <option value="one">one</option>
  36. <option value="two">two</option>
  37. <option value="three">three</option>
  38. </select>
  39.  
  40. </body>
  41. </html>

hope it helps you....
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 185
Reputation: aashishn86 is an unknown quantity at this point 
Solved Threads: 9
aashishn86's Avatar
aashishn86 aashishn86 is offline Offline
Junior Poster

Re: need coding for menu bar

 
0
  #4
Jun 3rd, 2009
you can make it better by inducing a delay, incase the user decides to change his mind...
with somthing like
  1. setTimeout("window.location='a.html'",1500);
in the IF
statement...
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:




Views: 922 | Replies: 3
Thread Tools Search this Thread



Tag cloud for ASP.NET
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2010 DaniWeb® LLC