Wednesday, January 4, 2012

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


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
1. Use the querystring:


3. Use Session State:

4.  Use public properties:

5. Use PreviousPage Control Info:

6. Use HttpContext Items Collection:

7. Use Cookies:

8. Use Cache: