Help needed with "add to favorites" link Romania
  • 13 years ago

    I need your help!

    I have a link called "add to favorites" and it would be a asp:HyperLink located on each page of my web site.
    The question is: If the user will add my page to the favorites, the next time he comes back to my site I don't want the "add to favorites" link to be visible anymore for him (because he added my page to favs already).

    I think that this can be done with javascript and cookies, but I don't know how...Sad
    The way I want to implement that is using VB.NET and again, I don't know how to do it.


    thanks in advance for any help.

  • 13 years ago

    You wont be able to grab the users favourites folder in a webpage, like you can with System.IO.DirectoryInfo in a winform app, but you can do a workaround like you say, when the javascript is called and the add to favourite code is fired you would also create a cookie and save "yes" to the cookie, now next time you load the page, you would check the cookie you created for a "yes" if it said yes then make the favourite asp link invisible else show. Now there are drawbacks as you wont know if the user has deleted the link and secondly cookies dont last forever unless specified when you create it and users dont delete them! My advice is too show the link all the time

  • 13 years ago

    Hi, Rollershade! 

    You're right. I should reconsider if I'll keep showing that link or remove it completly.

    Thank you very much !  Smiley Face [:)]

Post a reply

Enter your message below

Sign in or Join us (it's free).


Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Walking on water and developing software from a specification are easy if both are frozen.” - Edward V Berard