Click here to Skip to main content
15,889,867 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Is there any event which is fired when a value in the session is set.

Example:

On page:
www.abc.aspx?param=one and having code: Session["data"]="some data1";
www.abc.aspx?param=two and having code: Session["data"]="some data2";

I am searching for some event where i can change the key of the session some thing like this:

void SessionOverriding(object sender,Event ev)
{
string key= sender.geySessionKey("data"); // that is 'data' in my case
string qryString=sender.getQueryString("param"); // that will change for every page

string mydata=sender.getSessionData();

Session[key+qryString]=mydata;

}
Posted

1 solution

I think you can use Page_Load event

you can check your query string value and set your session
 
Share this answer
 
Comments
footballpardeep 26-Feb-14 14:29pm    
Problem is that it is not possible to go to every place on every page to that. I have lot's of pages.
Rana Zarour 26-Feb-14 14:36pm    
try to add your function on master page this will work good or try to create new page contains page_load event then inherits all your page from it

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