Last post Apr 30, 2012 06:11 AM by Pince
Apr 28, 2012 04:00 PM|Sparkles2012|LINK
I am developing a web application. At the login page a user(taxpayer) keys in his username which is actually a tax identification number. I have a database of all registered taxpayers. Once the user logs in, I want his tax identification number to be displayed
on subsequent pages that he will visit(usually in asp textboxes where he is to provide such identification number again). I also want his name and other relevant information to be automatically loaded into any required text fields on each page where necessary.
Apr 28, 2012 04:24 PM|XIII|LINK
you simply put that piece of information in the database and retrieve it when needed on subsequent pages. Or, if you want to keep it in memory for easy access you can also make use of
Session state. However note that you best not put too much information in Session state though so use it with care.
Apr 30, 2012 02:26 AM|Allen Li - MSFT|LINK
Hi, you can try ASP.NET Profile:
Apr 30, 2012 02:51 AM|patuary|LINK
In your case I prefer to use Session. on session end event all information of user will be destroied automatically.
Apr 30, 2012 06:11 AM|Pince|LINK
You can use Session to pass a value from one to another page, in your case create session and store all required values while the login like
Session["taxPayer"] = "Tax Payer Name";
And you can get the tax payer name from your needed page, like
string taxPayerName= Session["taxPayer"];
Finally close your seesion,
Session["taxPayer"] = null;
Session.Abandon(); //Close all sessions