Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old July 4th, 2007, 07:46 AM
Friend of Wrox
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi

hi there...

not to mess with all your code.. but I have this applied to an actual web site, you see the button of the current page in a diferent color...
just use something like this:
'private array that holds name of pages of at least part of them
    Private PaginaResalte() As String = New String(6) {"principal.aspx", "quees.aspx", "acciones", "bases", "equipo", "Informes", "Noticia"}

'this is the load of the master page!
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Dim i As Int32
        For i = 0 To PaginaResalte.GetLength(0) - 1
'try to find out if the page has something to do with the array...
            If Request.Url.AbsolutePath.ToLower.Contains(PaginaResalte(i).ToLower) Then
                Exit For
            End If
        Next i
'if not getting exit from another page not listed, just change the button to the highlighted one...
        If i < PaginaResalte.GetLength(0) Then
            Select Case i
                Case 0
                    BtnHome.ImageUrl = "~/images/home2.jpg"
                Case 1
                    BtnQueEs.ImageUrl = "~/images/que_es2.jpg"
                Case 2
                    BtnAcciones.ImageUrl = "~/images/acciones2.jpg"
                Case 3
                    BtnBases.ImageUrl = "~/images/bases2.jpg"
                Case 4
                    BtnEquipo.ImageUrl = "~/images/equipo2.jpg"
                Case 5
                    BtnInformes.ImageUrl = "~/images/informes2.jpg"
                Case 6
                    BtnNoticias.ImageUrl = "~/images/noticias2.jpg"
            End Select
        End If
    End Sub
all the buttons are originally on "off" state.. also you could write the javascript to roolover the buttons for all of them, and use two image controls , one with js and other with nothing and when you highlited a button, use the image that don't have js and put the js button invisible...



================================================== =========
Read this if you want to know how to get a correct reply for your question:
^^Took that from dparsons signature and he Took that from planoie's profile
================================================== =========
My programs achieved a new certification (can you say the same?):
================================================== =========
I know that CVS was evil, and now i got the proof:
================================================== =========
Old July 4th, 2007, 04:17 PM
Friend of Wrox
Join Date: Jul 2006
Posts: 238
Thanks: 0
Thanked 2 Times in 2 Posts
Send a message via MSN to rsearing


I was actually able to get this to work last night...by using something like Me.Page.GetTitle.GetbaseTitle.ToString.Substring(6 )

..or something like that..because the result without concantenating was admin_nameofpage.aspx I had to strip off the admin_ and then it worked.

MUCH thanks!!!

Old July 4th, 2007, 04:42 PM
Friend of Wrox
Join Date: Jul 2006
Posts: 238
Thanks: 0
Thanked 2 Times in 2 Posts
Send a message via MSN to rsearing


FYI--I just tried sending you a lengthy email to ************-- please email me an email I can send to?

Old July 4th, 2007, 08:21 PM
planoie's Avatar
Friend of Wrox
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts


Would you be so kind as to edit your previous post and edit out my email address. I am getting enough spam as it is. I'll check for you email.

Old July 5th, 2007, 01:22 AM
Friend of Wrox
Join Date: Jul 2006
Posts: 238
Thanks: 0
Thanked 2 Times in 2 Posts
Send a message via MSN to rsearing

I apologize, I didn't think it was good, as I received two undeliverables to it...I tried sending you a fairly lengthy email and it bounced back twice. Please eamil my hotmail acct and I will send--promise not take advantage of it.


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to tie to nested GridView inside DataList rsearing ASP.NET 2.0 Basics 6 June 18th, 2011 06:35 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.