Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Want to clear session variable on hyperlink click

Posted on 2008-10-27
Last Modified: 2008-10-30
I have a HyperLink on a Master Page. When the user click on it, he is directed to the Home Page. I want to write this code:

Session["DecryptedKey"] = "";

when the user clicks the HyperLink. But I noticed that a Click event is not available for the HyperLink. How to write the above line and where?
Question by:rpkhare

Accepted Solution

ASPSQLServerCOM earned 25 total points
ID: 22815782
could it be possible to write
Session["DecryptedKey"] = "";
on Home Page load


Author Comment

ID: 22815839
It is possible, but if it gets cleared on HyperLink Click then better.
LVL 20

Assisted Solution

brwwiggins earned 25 total points
ID: 22817079
You can't change the control to a linkbutton?
Otherwise you might have to hyperlink to a page that executes the code then redirects to default

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
ASP:Radiobuttonlist/asp:RadioButtonListItem custom styling 1 55
ASP.net Have sliders change in order 2 30
Web site error 3 44
ASP.NET (VB) return a record 2 37
One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question