Click here to Skip to main content
16,001,543 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have a page which generates an id.
i want to declare a session variable and assign id to it.
and want to access this id in all the pages .
i want to start the session after id is generated not while opening the browser.
could you please tell me the way to do it?
Posted

1 solution

Try this my friend.

On your btnGenerateID Click event, add the ff codes:
C#
Session["ID"] = GeneratedPassword();


Now on retrieval on every page, you can do this simply.
C#
lblWelcomeID.Text = Session["ID"].ToString();


Hope this one helps!

Regards,
Eduard
 
Share this answer
 

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