Click here to Skip to main content
15,891,763 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello friends,

I am using some hyperlinks in my web page.

This hyperlinks are dynamically generated hyperlinks. I have given a.visited color to be red but when i click on hyperlink it postback the page and when page postbacks it changes the hyperlinks state to unvisited.

Is there any way to persist the visited state of hyperlink???.

Can anybody suggest me for same.

Thanks in advance.
Shailesh J.
:-)
Posted

The simplest way is to use the same URL. If you're dynamically generating them to include some sort of verification code, put that in the session or in a cookie instead of in the linked URL. The browser will automatically show links to URLs that are in its history (or cache, I'm not 100% sure on how that works) in the visited colour.
 
Share this answer
 
Dynamically u can add CSS class to the hyper link based on the status
which u need to keep in ViewState or Session
 
Share this answer
 
Comments
saj_21 20-Jan-12 7:40am    
ok...but can you suggest me how to keep that dynamically generated hyperlinks into viewstate.
Hello,


Refer following class created in css. You can edit those as per your need.

.arial12grey
{

border:0px;
border-style:none;
font-family:arial;
/*font-size: 8pt;color: #8c8c8c;*/
font-weight: normal;


}

a.arial12grey
{
border:0px;
border-style:none;
font-family:arial;
font-size: 8pt;
font-weight: normal;
color: #8c8c8c;
text-align:center;
text-decoration:none;

}
a.arial12grey:hover
{border:0px;
font-family:arial;
font-size: 8pt;
font-weight: normal;
color: #000000;
text-decoration: none;
/*line-height: normal;*/
}

While generating the hyperlink dynamically attache this CssClass to those hyperlink.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900