Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Hyperlink control visited / unvisited behavior - I don't get it

Reply
Thread Tools

Hyperlink control visited / unvisited behavior - I don't get it

 
 
Don M
Guest
Posts: n/a
 
      01-25-2004
I am currently using a Hyperlink Column in a Datagrid to display
images of the Datagrid line item when a user clicks on the link. The
visited / unvisited color change of the Hyperlink is very usefull in
letting users know what they have already looked at.

However in my app when a user navigates back to the page with the
datagrid, I would like to set the Hyperlink column to the unvisited
state.

I have attempted to resolve this per conrol by converting the
Hyperlink Column to a template column to disable the controls
ViewState. I have also played disabling the datagrid and page
ViewState.

Just for kicks I decided to try out the Link Button control but this
is also behaving in the same way.

Admittedly my HTML skills are not very strong. What am I missing here?
Is this client side browser stuff that is out of my control?

Thanks in advance for any insight or suggestions.
 
Reply With Quote
 
 
 
 
Alessandro Zifiglio
Guest
Posts: n/a
 
      01-25-2004
The select state of an anchor element is to show visitors that they have
already visited the link. Now why would you want to change this behaviour.
If a user hits the back button on the browser surely any links they already
visited will have the visited state.

To answer your question, yes you can control this through css style for your
hyperlink control , but you wont be able to do exactly what you want that is
when hitting the back button make those changes. You will have to resort to
a combination of javascript and css, that is to check if the user hit the
back button to get on the page and if they did to change the css style from
javascript.


In css the ability to change the properties of a element based on the state
of the element can be accomplished by using a Pseudo Class Element.

The Anchor < A > element can have different rendering properties applied to
it based upon the current state.

The possible variations include:

link - unvisited links
visited - visited links
hover - user hovers
active - active links

so to apply this you would do :


..datagrid a: link {
color: blue;
}

..datagrid a: visited {
color: blue;
}


..datagrid a: hover {
color: green;
}

..datagrid a: active {
color: yellow;
}

now all you need to do is suppy "datagrid" to your cssclass property of your
hyperlink control, the one displaying in your grid. Notice how in the above
example the visited state and the unvisited state have the same color blue.
But rem now when clicking on a link your user wont know if it is visited or
not visited. To achieve what you need combine this will javascript.




"Don M" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) om...
> I am currently using a Hyperlink Column in a Datagrid to display
> images of the Datagrid line item when a user clicks on the link. The
> visited / unvisited color change of the Hyperlink is very usefull in
> letting users know what they have already looked at.
>
> However in my app when a user navigates back to the page with the
> datagrid, I would like to set the Hyperlink column to the unvisited
> state.
>
> I have attempted to resolve this per conrol by converting the
> Hyperlink Column to a template column to disable the controls
> ViewState. I have also played disabling the datagrid and page
> ViewState.
>
> Just for kicks I decided to try out the Link Button control but this
> is also behaving in the same way.
>
> Admittedly my HTML skills are not very strong. What am I missing here?
> Is this client side browser stuff that is out of my control?
>
> Thanks in advance for any insight or suggestions.



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to get info about the site visited before my site? jensen bredal ASP .Net 2 04-15-2005 06:10 PM
making hyperlink look 'visited' Al Cadalzo ASP .Net Web Controls 2 04-24-2004 01:06 PM
Change text color of "visited link" back to unvisited color ??? Matt Adams HTML 0 08-26-2003 10:27 AM
How to get rid of history of the web sites visited Ch. Rajinder Nijjhar Jatt Computer Support 2 07-15-2003 09:33 AM
Parental Control of Sites Visited Michael Bugala Computer Support 1 07-05-2003 08:49 PM



Advertisments