Wednesday, January 4, 2012

Need to clear up session data when log out in ASP.NET

Session.Abandon

http://msdn.microsoft.com/en-us/library/ms524310.aspx



If you do not call the Abandon method explicitly, the server destroys these objects when the session times out.

How to delete a user from ASP.NET membership database by SQL?

   DECLARE @UserId uniqueidentifier

   SET @UserId = 'userid in here F6817A3F-D0AF-4715-8A5C-4750E2C9EA2D'
   
   DELETE FROM aspnet_Profile WHERE UserID = @UserId

   DELETE FROM aspnet_UsersInRoles WHERE UserID = @UserId

   DELETE FROM aspnet_PersonalizationPerUser WHERE UserID = @UserId

   DELETE FROM dbo.aspnet_Membership WHERE UserID = @UserId

   DELETE FROM aspnet_users WHERE UserID = @UserId


Eight Ways to Transfer Data from One Page to Another Page in ASP.NET webform

http://www.eggheadcafe.com/tutorials/asp-net/e653f028-01fb-4d0e-843b-058deae562a2/eight-different-ways-to-transfer-data-from-one-page-to-another-page.aspx
1. Use the querystring:

2. Use HTTP POST:

3. Use Session State:

4.  Use public properties:

5. Use PreviousPage Control Info:

6. Use HttpContext Items Collection:

7. Use Cookies:

8. Use Cache: