This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > FrontPage Programming > June 2007 > setting current state for a page with asp and css





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author setting current state for a page with asp and css
dothvader

2007-05-25, 6:16 pm

I have set up a "current" state with CSS for navigational links of a
website.

#nav a:link.current, #nav a:visited.current {background-
color:#800000;color:white;}
#nav a:hover.current {background-color:#800000; color:white;
cursor:default}

I am using asp to inlucde headers and footers with navigation. I want
to interface with CSS to show a current state for a current page. I
can do this with html ie.<a href="index.asp" class="current">Home</a>
but I have to use a static navigational bar which stays with the
page. I am not sure how to set this up with asp?

thanks

Stefan B Rusynko

2007-05-26, 6:15 am

Set up your class in the html page as a ASP variable
a href="index.asp" class="<%=className%>">
The use you server side code to change the style

<%
IF ..... THEN
className="current"
ELSE
className="someotherstylename "
END IF
%>

--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
_____________________________________________


"dothvader" <mark@trekwest.com> wrote in message news:1180113449.460528.183520@o5g2000hsb.googlegroups.com...
|I have set up a "current" state with CSS for navigational links of a
| website.
|
| #nav a:link.current, #nav a:visited.current {background-
| color:#800000;color:white;}
| #nav a:hover.current {background-color:#800000; color:white;
| cursor:default}
|
| I am using asp to inlucde headers and footers with navigation. I want
| to interface with CSS to show a current state for a current page. I
| can do this with html ie.<a href="index.asp" class="current">Home</a>
| but I have to use a static navigational bar which stays with the
| page. I am not sure how to set this up with asp?
|
| thanks
|


dothvader

2007-05-29, 10:20 pm

On May 26, 2:15 am, "Stefan B Rusynko" <sbr_en...@hotmail.com> wrote:
> Set up your class in the html page as a ASP variable
> a href="index.asp" class="<%=className%>">
> The use you server side code to change the style
>
> <%
> IF ..... THEN
> className="current"
> ELSE
> className="someotherstylename "
> END IF
> %>
>
> --
>
> _____________________________________________
> SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
> "Warning - Using the F1 Key will not break anything!" (-;
> _____________________________________________
>
> "dothvader" <m...@trekwest.com> wrote in messagenews:1180113449.460528.183520@o5g2000hsb.googlegroups.com...
>
> |I have set up a "current" state with CSS for navigational links of a
> | website.
> |
> | #nav a:link.current, #nav a:visited.current {background-
> | color:#800000;color:white;}
> | #nav a:hover.current {background-color:#800000; color:white;
> | cursor:default}
> |
> | I am using asp to inlucde headers and footers with navigation. I want
> | to interface with CSS to show a current state for a current page. I
> | can do this with html ie.<a href="index.asp" class="current">Home</a>
> | but I have to use a static navigational bar which stays with the
> | page. I am not sure how to set this up with asp?
> |
> | thanks
> |


Ok, I understand the logic, but I was wondering if I could set up
somthing so that when asp reads a variable on a certain page it
triggers the current state of the navigation. In other words is there
a simpler way than an if then statement?

If the answer is no then I am having trouble with the exact wording
of the if then statement.

thanks

Stefan B Rusynko

2007-05-30, 6:18 am

The IF THEN is the simplest test for a single condition test

Say you have a ASP variable named "nextpagename" that is supposed to be "index.asp"
<%
IF nextpagename="index.asp" THEN
className="current"
ELSE
className="someotherstylename "
END IF
%>

then your html becomes
<a href="index.asp" class="<%=className%>">Home page</a>

If you still are having problems post a real variable from your page and the condition you are looking for
--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
_____________________________________________


"dothvader" <mark@trekwest.com> wrote in message news:1180480590.213981.4330@q69g2000hsb.googlegroups.com...
| On May 26, 2:15 am, "Stefan B Rusynko" <sbr_en...@hotmail.com> wrote:
| > Set up your class in the html page as a ASP variable
| > a href="index.asp" class="<%=className%>">
| > The use you server side code to change the style
| >
| > <%
| > IF ..... THEN
| > className="current"
| > ELSE
| > className="someotherstylename "
| > END IF
| > %>
| >
| > --
| >
| > _____________________________________________
| > SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
| > "Warning - Using the F1 Key will not break anything!" (-;
| > _____________________________________________
| >
| > "dothvader" <m...@trekwest.com> wrote in messagenews:1180113449.460528.183520@o5g2000hsb.googlegroups.com...
| >
| > |I have set up a "current" state with CSS for navigational links of a
| > | website.
| > |
| > | #nav a:link.current, #nav a:visited.current {background-
| > | color:#800000;color:white;}
| > | #nav a:hover.current {background-color:#800000; color:white;
| > | cursor:default}
| > |
| > | I am using asp to inlucde headers and footers with navigation. I want
| > | to interface with CSS to show a current state for a current page. I
| > | can do this with html ie.<a href="index.asp" class="current">Home</a>
| > | but I have to use a static navigational bar which stays with the
| > | page. I am not sure how to set this up with asp?
| > |
| > | thanks
| > |
|
| Ok, I understand the logic, but I was wondering if I could set up
| somthing so that when asp reads a variable on a certain page it
| triggers the current state of the navigation. In other words is there
| a simpler way than an if then statement?
|
| If the answer is no then I am having trouble with the exact wording
| of the if then statement.
|
| thanks
|


dothvader

2007-05-30, 10:33 pm

Ok, I tried setting up If Elseif but I don't have it correct I really
don't need another type of condition ie. className="someotherstylename
". It shoudl just default to my standard hyperlink class. This is
what I have -

<%
If currentpage="index.asp" Then
className="current"
ElseIf
If currentpage="test.asp" Then
className="current"
ElseIf
If currentpage="contact.asp" Then
className="current"
End If
%>

I then set up the trigger to -

<% currentpage = "test.asp" %>

I know this does not work so what am I missing?

thanks



On May 30, 2:25 am, "Stefan B Rusynko" <sbr_en...@hotmail.com> wrote:
> The IF THEN is the simplest test for a single condition test
>
> Say you have a ASP variable named "nextpagename" that is supposed to be "index.asp"
> <%
> IF nextpagename="index.asp" THEN
> className="current"
> ELSE
> className="someotherstylename "
> END IF
> %>
>
> then your html becomes
> <a href="index.asp" class="<%=className%>">Home page</a>
>
> If you still are having problems post a real variable from your page and the condition you are looking for
> --
>
> _____________________________________________
> SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
> "Warning - Using the F1 Key will not break anything!" (-;
> _____________________________________________
>
> "dothvader" <m...@trekwest.com> wrote in messagenews:1180480590.213981.4330@q69g2000hsb.googlegroups.com...
>
> | On May 26, 2:15 am, "Stefan B Rusynko" <sbr_en...@hotmail.com> wrote:
> | > Set up your class in the html page as a ASP variable
> | > a href="index.asp" class="<%=className%>">
> | > The use you server side code to change the style
> | >
> | > <%
> | > IF ..... THEN
> | > className="current"
> | > ELSE
> | > className="someotherstylename "
> | > END IF
> | > %>
> | >
> | > --
> | >
> | > _____________________________________________
> | > SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
> | > "Warning - Using the F1 Key will not break anything!" (-;
> | > _____________________________________________
> | >
> | > "dothvader" <m...@trekwest.com> wrote in messagenews:1180113449.460528.183520@o5g2000hsb.googlegroups.com...
> | >
> | > |I have set up a "current" state with CSS for navigational links of a
> | > | website.
> | > |
> | > | #nav a:link.current, #nav a:visited.current {background-
> | > | color:#800000;color:white;}
> | > | #nav a:hover.current {background-color:#800000; color:white;
> | > | cursor:default}
> | > |
> | > | I am using asp to inlucde headers and footers with navigation. I want
> | > | to interface with CSS to show a current state for a current page. I
> | > | can do this with html ie.<a href="index.asp" class="current">Home</a>
> | > | but I have to use a static navigational bar which stays with the
> | > | page. I am not sure how to set this up with asp?
> | > |
> | > | thanks
> | > |
> |
> | Ok, I understand the logic, but I was wondering if I could set up
> | somthing so that when asp reads a variable on a certain page it
> | triggers the current state of the navigation. In other words is there
> | a simpler way than an if then statement?
> |
> | If the answer is no then I am having trouble with the exact wording
> | of the if then statement.
> |
> | thanks
> |



Thomas A. Rowe

2007-05-31, 6:17 pm

<%
If currentpage="index.asp" Then
className="current1"
ElseIf currentpage="test.asp" Then
className="current2"
ElseIf currentpage="contact.asp" Then
className="current3"
Else
className="current"
End If
%>

--
==============================================
Thomas A. Rowe
Microsoft MVP - FrontPage

http://www.Ecom-Data.com
==============================================


"dothvader" <mark@trekwest.com> wrote in message
news:1180576121.723073.33400@q66g2000hsg.googlegroups.com...
> Ok, I tried setting up If Elseif but I don't have it correct I really
> don't need another type of condition ie. className="someotherstylename
> ". It shoudl just default to my standard hyperlink class. This is
> what I have -
>
> <%
> If currentpage="index.asp" Then
> className="current"
> ElseIf
> If currentpage="test.asp" Then
> className="current"
> ElseIf
> If currentpage="contact.asp" Then
> className="current"
> End If
> %>
>
> I then set up the trigger to -
>
> <% currentpage = "test.asp" %>
>
> I know this does not work so what am I missing?
>
> thanks
>
>
>
> On May 30, 2:25 am, "Stefan B Rusynko" <sbr_en...@hotmail.com> wrote:
>
>



dothvader

2007-05-31, 6:17 pm

Getting closer but not there yet. I've played around with this and
still can't get it. I've set up a page so that you can see what I am
after:

http://trekwest.com/test.asp

Your suggestion put everthing into a "current" state. Also what about
the trigger <% currentpage = "test.asp" %> of identifying the page?

thanks again.

On May 31, 6:20 am, "Thomas A. Rowe" <tar...@mvps.org> wrote:[color=darkred]
> <%
> If currentpage="index.asp" Then
> className="current1"
> ElseIf currentpage="test.asp" Then
> className="current2"
> ElseIf currentpage="contact.asp" Then
> className="current3"
> Else
> className="current"
> End If
> %>
>
> --
> ==============================================
> Thomas A. Rowe
> Microsoft MVP - FrontPage
>
> http://www.Ecom-Data.com
> ==============================================
>
> "dothvader" <m...@trekwest.com> wrote in message
>
> news:1180576121.723073.33400@q66g2000hsg.googlegroups.com...
>
>
>
>
>
>
>
>
>
>
>
>
>


Thomas A. Rowe

2007-05-31, 6:17 pm

Here is an example of what I use to change the background and font color of links in a navigation
bar/table (I prefer to not use CSS):

The Menu style is specified on each page:

<%
MenuStyle = "B"
%>

The following is a ASP included inserted into all pages after the above MenuStyle:

<%
If MenuStyle = "A" then
CellBkgrd1 = "#CE0000"
FontColor1 = "#FFFFFF"
CellBkgrd2 = "#003897"
FontColor2 = "#FFFFFF"
CellBkgrd3 = "#CE0000"
FontColor3 = "#FFFFFF"
CellBkgrd4 = "#CE0000"
FontColor4 = "#FFFFFF"
CellBkgrd5 = "#CE0000"
FontColor5 = "#FFFFFF"
End If

If MenuStyle = "B" then
CellBkgrd1 = "#CE0000"
FontColor1 = "#FFFFFF"
CellBkgrd2 = "#CE0000"
FontColor2 = "#FFFFFF"
CellBkgrd3 = "#003897"
FontColor3 = "#FFFFFF"
CellBkgrd4 = "#CE0000"
FontColor4 = "#FFFFFF"
CellBkgrd5 = "#CE0000"
FontColor5 = "#FFFFFF"
End If

%>
==============================================
Thomas A. Rowe
Microsoft MVP - FrontPage

http://www.Ecom-Data.com
==============================================


"dothvader" <mark@trekwest.com> wrote in message
news:1180632439.107468.161840@p77g2000hsh.googlegroups.com...
> Getting closer but not there yet. I've played around with this and
> still can't get it. I've set up a page so that you can see what I am
> after:
>
> http://trekwest.com/test.asp
>
> Your suggestion put everthing into a "current" state. Also what about
> the trigger <% currentpage = "test.asp" %> of identifying the page?
>
> thanks again.
>
> On May 31, 6:20 am, "Thomas A. Rowe" <tar...@mvps.org> wrote:
>
>



dothvader

2007-05-31, 10:29 pm

I appreciate your reply but I want to keep it simple. What I suggest
should work but I can't figure the logic.

thanks

On May 31, 11:54 am, "Thomas A. Rowe" <tar...@mvps.org> wrote:[color=darkred]
> Here is an example of what I use to change the background and font color of links in a navigation
> bar/table (I prefer to not use CSS):
>
> The Menu style is specified on each page:
>
> <%
> MenuStyle = "B"
> %>
>
> The following is aASPincluded inserted into all pages after the above MenuStyle:
>
> <%
> If MenuStyle = "A" then
> CellBkgrd1 = "#CE0000"
> FontColor1 = "#FFFFFF"
> CellBkgrd2 = "#003897"
> FontColor2 = "#FFFFFF"
> CellBkgrd3 = "#CE0000"
> FontColor3 = "#FFFFFF"
> CellBkgrd4 = "#CE0000"
> FontColor4 = "#FFFFFF"
> CellBkgrd5 = "#CE0000"
> FontColor5 = "#FFFFFF"
> End If
>
> If MenuStyle = "B" then
> CellBkgrd1 = "#CE0000"
> FontColor1 = "#FFFFFF"
> CellBkgrd2 = "#CE0000"
> FontColor2 = "#FFFFFF"
> CellBkgrd3 = "#003897"
> FontColor3 = "#FFFFFF"
> CellBkgrd4 = "#CE0000"
> FontColor4 = "#FFFFFF"
> CellBkgrd5 = "#CE0000"
> FontColor5 = "#FFFFFF"
> End If
>
> %>
> ==============================================
> Thomas A. Rowe
> Microsoft MVP - FrontPage
>
> http://www.Ecom-Data.com
> ==============================================
>
> "dothvader" <m...@trekwest.com> wrote in message
>
> news:1180632439.107468.161840@p77g2000hsh.googlegroups.com...
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>


Stefan B Rusynko

2007-06-01, 6:17 am

That will result in a True or False result
<% currentpage = "test.asp" %>
means If it is then True (currentpage = "test.asp")
Else it is False (currentpage <> "test.asp")

That is the same as an IF Else statement

Your problem on your test page is
- you need the server to determine the page name
(ASP has no way of telling if "currentpage" is anything unless you add something to parse the page name)
- you need to use style classes that are defined in your style sheet
(only a default (no class) and "current" are defined)
- whatever you test for, one of the tests will alway be true hwmney your page name matched the on eyou are looking for

To add only the class named "current" to the current page (if it is named say test.asp), and not add a class to the other links
- all your links need to have unique server side code for the class for each link
(and you really only need to test for the one page you want to change the style on since you don't have multiuple styles)

Paste the below in your test page

<%
'Build links and set default styles (no class) for all pages
page1="index.asp"
page2="test.asp"
page3="contact.asp"
classname1=""
classname2=""
classname3=""

'Determine the page name of current page
PageURL = Request.ServerVariables("SCRIPT_NAME")
SearchChar = "/"
PagePos = InstrRev(PageURL, SearchChar)
IF PagePos>0 AND PagePos< Len(PageURL) THEN
currentPage = Lcase(Right(PageURL,Len(PageURL)-PagePos))
End If

'Set class for this pageX to classnameX
If currentPage=page2 Then classname2=classname2 & " class='current'"
'Change pageX and classnameX for each page you use the script on
%>

Then your links on all pages would be :

<div id="botnav">
<a href="index.asp"<%=classname1%>>Home</a>
<a href="test.asp"<%=classname2%>>Test</a>
<a href="contact.asp"<%=classname3%>>Contact Us</a>
</div>

PS
validate your CSS - you have style errors in it


--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
_____________________________________________


"dothvader" <mark@trekwest.com> wrote in message news:1180632439.107468.161840@p77g2000hsh.googlegroups.com...
| Getting closer but not there yet. I've played around with this and
| still can't get it. I've set up a page so that you can see what I am
| after:
|
| http://trekwest.com/test.asp
|
| Your suggestion put everthing into a "current" state. Also what about
| the trigger <% currentpage = "test.asp" %> of identifying the page?
|
| thanks again.
|
| On May 31, 6:20 am, "Thomas A. Rowe" <tar...@mvps.org> wrote:
| > <%
| > If currentpage="index.asp" Then
| > className="current1"
| > ElseIf currentpage="test.asp" Then
| > className="current2"
| > ElseIf currentpage="contact.asp" Then
| > className="current3"
| > Else
| > className="current"
| > End If
| > %>
| >
| > --
| > ==============================================
| > Thomas A. Rowe
| > Microsoft MVP - FrontPage
| >
| > http://www.Ecom-Data.com
| > ==============================================
| >
| > "dothvader" <m...@trekwest.com> wrote in message
| >
| > news:1180576121.723073.33400@q66g2000hsg.googlegroups.com...
| >
| > > Ok, I tried setting up If Elseif but I don't have it correct I really
| > > don't need another type of condition ie. className="someotherstylename
| > > ". It shoudl just default to my standard hyperlink class. This is
| > > what I have -
| >
| > > <%
| > > If currentpage="index.asp" Then
| > > className="current"
| > > ElseIf
| > > If currentpage="test.asp" Then
| > > className="current"
| > > ElseIf
| > > If currentpage="contact.asp" Then
| > > className="current"
| > > End If
| > > %>
| >
| > > I then set up the trigger to -
| >
| > > <% currentpage = "test.asp" %>
| >
| > > I know this does not work so what am I missing?
| >
| > > thanks
| >
| > > On May 30, 2:25 am, "Stefan B Rusynko" <sbr_en...@hotmail.com> wrote:
| > >> The IF THEN is the simplest test for a single condition test
| >
| > >> Say you have a ASP variable named "nextpagename" that is supposed to be "index.asp"
| > >> <%
| > >> IF nextpagename="index.asp" THEN
| > >> className="current"
| > >> ELSE
| > >> className="someotherstylename "
| > >> END IF
| > >> %>
| >
| > >> then your html becomes
| > >> <a href="index.asp" class="<%=className%>">Home page</a>
| >
| > >> If you still are having problems post a real variable from your page and the condition you are
| > >> looking for
| > >> --
| >
| > >> _____________________________________________
| > >> SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
| > >> "Warning - Using the F1 Key will not break anything!" (-;
| > >> _____________________________________________
| >
| > >> "dothvader" <m...@trekwest.com> wrote in
| > >> messagenews:1180480590.213981.4330@q69g2000hsb.googlegroups.com...
| >
| > >> | On May 26, 2:15 am, "Stefan B Rusynko" <sbr_en...@hotmail.com> wrote:
| > >> | > Set up your class in the html page as a ASP variable
| > >> | > a href="index.asp" class="<%=className%>">
| > >> | > The use you server side code to change the style
| > >> | >
| > >> | > <%
| > >> | > IF ..... THEN
| > >> | > className="current"
| > >> | > ELSE
| > >> | > className="someotherstylename "
| > >> | > END IF
| > >> | > %>
| > >> | >
| > >> | > --
| > >> | >
| > >> | > _____________________________________________
| > >> | > SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
| > >> | > "Warning - Using the F1 Key will not break anything!" (-;
| > >> | > _____________________________________________
| > >> | >
| > >> | > "dothvader" <m...@trekwest.com> wrote in
| > >> messagenews:1180113449.460528.183520@o5g2000hsb.googlegroups.com...
| > >> | >
| > >> | > |I have set up a "current" state with CSS for navigational links of a
| > >> | > | website.
| > >> | > |
| > >> | > | #nav a:link.current, #nav a:visited.current {background-
| > >> | > | color:#800000;color:white;}
| > >> | > | #nav a:hover.current {background-color:#800000; color:white;
| > >> | > | cursor:default}
| > >> | > |
| > >> | > | I am using asp to inlucde headers and footers with navigation. I want
| > >> | > | to interface with CSS to show a current state for a current page. I
| > >> | > | can do this with html ie.<a href="index.asp" class="current">Home</a>
| > >> | > | but I have to use a static navigational bar which stays with the
| > >> | > | page. I am not sure how to set this up with asp?
| > >> | > |
| > >> | > | thanks
| > >> | > |
| > >> |
| > >> | Ok, I understand the logic, but I was wondering if I could set up
| > >> | somthing so that when asp reads a variable on a certain page it
| > >> | triggers the current state of the navigation. In other words is there
| > >> | a simpler way than an if then statement?
| > >> |
| > >> | If the answer is no then I am having trouble with the exact wording
| > >> | of the if then statement.
| > >> |
| > >> | thanks
| > >> |
|
|


dothvader

2007-06-01, 6:16 pm

Eureka! The solution was so simple it finally hit me in the head.

Thank you for your brilliant and well thought out logic but it wasn't
neccessary. The key to this whole problem was a trigger or switch.
The only state to trigger was on every other case would be default. I
stumbled across the answer while working with the code you suggested.
The beauty is in it's simplcity and no if then statements.

In the current page you want to trigger the class as current you put
the following:

<% currentPage#="current" %>

then you set each link to correspond to that class:

<a href="index.asp" class="<%=currentPage1%>">Home</a>
<a href="test.asp" class="<%=currentPage2%>">Test</a>
<a href="contact.asp" class="<%=currentPage3%>">Contact Us</a>

See the results - http://trekwest.com/test.asp

praise god!


On Jun 1, 3:56 am, "Stefan B Rusynko" <sbr_en...@hotmail.com> wrote:
> That will result in a True or False result
> <% currentpage = "test.asp" %>
> means If it is then True (currentpage = "test.asp")
> Else it is False (currentpage <> "test.asp")
>
> That is the same as an IF Else statement
>
> Your problem on your test page is
> - you need the server to determine the page name
> (ASP has no way of telling if "currentpage" is anything unless you add something to parse the page name)
> - you need to use style classes that are defined in your style sheet
> (only a default (no class) and "current" are defined)
> - whatever you test for, one of the tests will alway be true hwmney your page name matched the on eyou are looking for
>
> To add only the class named "current" to the current page (if it is named say test.asp), and not add a class to the other links
> - all your links need to have unique server side code for the class for each link
> (and you really only need to test for the one page you want to change the style on since you don't have multiuple styles)
>
> Paste the below in your test page
>
> <%
> 'Build links and set default styles (no class) for all pages
> page1="index.asp"
> page2="test.asp"
> page3="contact.asp"
> classname1=""
> classname2=""
> classname3=""
>
> 'Determine the page name of current page
> PageURL = Request.ServerVariables("SCRIPT_NAME")
> SearchChar = "/"
> PagePos = InstrRev(PageURL, SearchChar)
> IF PagePos>0 AND PagePos< Len(PageURL) THEN
> currentPage = Lcase(Right(PageURL,Len(PageURL)-PagePos))
> End If
>
> 'Set class for this pageX to classnameX
> If currentPage=page2 Then classname2=classname2 & " class='current'"
> 'Change pageX and classnameX for each page you use the script on
> %>
>
> Then your links on all pages would be :
>
> <div id="botnav">
> <a href="index.asp"<%=classname1%>>Home</a>
> <a href="test.asp"<%=classname2%>>Test</a>
> <a href="contact.asp"<%=classname3%>>Contact Us</a>
> </div>
>
> PS
> validate your CSS - you have style errors in it
>
> --
>
> _____________________________________________
> SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
> "Warning - Using the F1 Key will not break anything!" (-;
> _____________________________________________
>
> "dothvader" <m...@trekwest.com> wrote in messagenews:1180632439.107468.161840@p77g2000hsh.googlegroups.com...
>
> | Getting closer but not there yet. I've played around with this and
> | still can't get it. I've set up a page so that you can see what I am
> | after:
> |
> |http://trekwest.com/test.asp
> |
> | Your suggestion put everthing into a "current" state. Also what about
> | the trigger <% currentpage = "test.asp" %> of identifying the page?
> |
> | thanks again.
> |
> | On May 31, 6:20 am, "Thomas A. Rowe" <tar...@mvps.org> wrote:
> | > <%
> | > If currentpage="index.asp" Then
> | > className="current1"
> | > ElseIf currentpage="test.asp" Then
> | > className="current2"
> | > ElseIf currentpage="contact.asp" Then
> | > className="current3"
> | > Else
> | > className="current"
> | > End If
> | > %>
> | >
> | > --
> | > ==============================================
> | > Thomas A. Rowe
> | > Microsoft MVP - FrontPage
> | >
> | >http://www.Ecom-Data.com
> | > ==============================================
> | >
> | > "dothvader" <m...@trekwest.com> wrote in message
> | >
> | >news:1180576121.723073.33400@q66g2000hsg.googlegroups.com...
> | >
> | > > Ok, I tried setting up If Elseif but I don't have it correct I really
> | > > don't need another type of condition ie. className="someotherstylename
> | > > ". It shoudl just default to my standard hyperlink class. This is
> | > > what I have -
> | >
> | > > <%
> | > > If currentpage="index.asp" Then
> | > > className="current"
> | > > ElseIf
> | > > If currentpage="test.asp" Then
> | > > className="current"
> | > > ElseIf
> | > > If currentpage="contact.asp" Then
> | > > className="current"
> | > > End If
> | > > %>
> | >
> | > > I then set up the trigger to -
> | >
> | > > <% currentpage = "test.asp" %>
> | >
> | > > I know this does not work so what am I missing?
> | >
> | > > thanks
> | >
> | > > On May 30, 2:25 am, "Stefan B Rusynko" <sbr_en...@hotmail.com> wrote:
> | > >> The IF THEN is the simplest test for a single condition test
> | >
> | > >> Say you have a ASP variable named "nextpagename" that is supposed to be "index.asp"
> | > >> <%
> | > >> IF nextpagename="index.asp" THEN
> | > >> className="current"
> | > >> ELSE
> | > >> className="someotherstylename "
> | > >> END IF
> | > >> %>
> | >
> | > >> then your html becomes
> | > >> <a href="index.asp" class="<%=className%>">Home page</a>
> | >
> | > >> If you still are having problems post a real variable from your page and the condition you are
> | > >> looking for
> | > >> --
> | >
> | > >> _____________________________________________
> | > >> SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
> | > >> "Warning - Using the F1 Key will not break anything!" (-;
> | > >> _____________________________________________
> | >
> | > >> "dothvader" <m...@trekwest.com> wrote in
> | > >> messagenews:1180480590.213981.4330@q69g2000hsb.googlegroups.com...
> | >
> | > >> | On May 26, 2:15 am, "Stefan B Rusynko" <sbr_en...@hotmail.com> wrote:
> | > >> | > Set up your class in the html page as a ASP variable
> | > >> | > a href="index.asp" class="<%=className%>">
> | > >> | > The use you server side code to change the style
> | > >> | >
> | > >> | > <%
> | > >> | > IF ..... THEN
> | > >> | > className="current"
> | > >> | > ELSE
> | > >> | > className="someotherstylename "
> | > >> | > END IF
> | > >> | > %>
> | > >> | >
> | > >> | > --
> | > >> | >
> | > >> | > _____________________________________________
> | > >> | > SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
> | > >> | > "Warning - Using the F1 Key will not break anything!" (-;
> | > >> | > _____________________________________________
> | > >> | >
> | > >> | > "dothvader" <m...@trekwest.com> wrote in
> | > >> messagenews:1180113449.460528.183520@o5g2000hsb.googlegroups.com...
> | > >> | >
> | > >> | > |I have set up a "current" state with CSS for navigational links of a
> | > >> | > | website.
> | > >> | > |
> | > >> | > | #nav a:link.current, #nav a:visited.current {background-
> | > >> | > | color:#800000;color:white;}
> | > >> | > | #nav a:hover.current {background-color:#800000; color:white;
> | > >> | > | cursor:default}
> | > >> | > |
> | > >> | > | I am using asp to inlucde headers and footers with navigation. I want
> | > >> | > | to interface with CSS to show a current state for a current page. I
> | > >> | > | can do this with html ie.<a href="index.asp" class="current">Home</a>
> | > >> | > | but I have to use a static navigational bar which stays with the
> | > >> | > | page. I am not sure how to set this up with asp?
> | > >> | > |
> | > >> | > | thanks
> | > >> | > |
> | > >> |
> | > >> | Ok, I understand the logic, but I was wondering if I could set up
> | > >> | somthing so that when asp reads a variable on a certain page it
> | > >> | triggers the current state of the navigation. In other words is there
> | > >> | a simpler way than an if then statement?
> | > >> |
> | > >> | If the answer is no then I am having trouble with the exact wording
> | > >> | of the if then statement.
> | > >> |
> | > >> | thanks
> | > >> |
> |
> |



Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews