.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Post New Web Links

how to Logout completely

Posted By:      Posted Date: October 25, 2010    Points: 0   Category :ASP.Net

 Hi all,

I am using Logout button in my pages.Logout button calls the Logout.aspx page.



protected void Page_Load(object sender, EventArgs e)







if ((string)Session["uname"] == null)

My Logout button is working fine in normal case.

But when I will allow my username,password to Remember the browser,at that time when I click on Logout button ,it will logout,,but when i try to click on backbutton it will show the previous pages.

What I need to do to compelte logout?




View Complete Post

More Related Resource Links

How to process data AFTER page is completely loaded for the user?


I have some logging that has to be done, which are some database update or inserts.

However this logging is of no importance to the user, so I only want to process the data/logs after the page is completed for the user.
As of now, if I process the data while the page is loading, I go from 1.4 to 2.0 speed (server side time processing of code), which is quite a bit comparing it is of no use to the user.

So I want this code only executed after that the page is complete.

I've been checking out Ajax, async pages etc, but the problem is it still gets executed before the page is rendered to the client, which means the client will have to wait longer then it is not being processed.

I've been checking out Threadpool.queueBackgroundWorker, however if I get it correct, this will still be executed before the page is shown to the user, as it has to complete before the prerender.

Then I thought about creating a new thread, and do the processing there, which would not have my page waiting to complete the data/logging.
However when I have 100 or 200 users loading pages at the same time, then that would mean I would be creating 200 threads on those loads, which I doubt will be good for performance. So if I want to solve this, I would have to create my own threadpool and only assign for example a max of 40 threads to it which can pr

Logout not redirecting correctly


I have the following control on my master page


asp:LoginStatus ID="LoginStatus1" runat

Close Tab doesn't logout


When closing my tab, Formsauthentication doesn't clear, thanks!

protected void Login1_Authenticate(object sender, AuthenticateEventArgs e)

      if (Classes.CStaticDataAccess.AuthenticateUser(Login1.UserName, Login1.Password))
        FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(1, Login1.UserName, DateTime.Now, DateTime.Now.AddMinutes(1), false, "");
        string secureTicket = FormsAuthentication.Encrypt(ticket);
        HttpCookie authCookie = new HttpCookie(FormsAuthentication.FormsCookieName, secureTicket);
        string redirectUrl = FormsAuthentication.GetRedirectUrl(Login1.UserName, false);

       // System.Web.Security.FormsAuthentication.SetAuthCookie(Login1.UserName, false);
        e.Authenticated = true;

        e.Authenticated = false;

 <authentication mode="Forms">
      <forms name=".ASPXFORMSAUTH" loginUrl="~/Ware2Login.aspx" protection="All" timeout="30" path="/" ></forms>
      <deny users="?"/>

sql server 2008 import/export wizard... completely useless??



import/export wizard in 2000 had lots of options.

I could copy databases without a care in the world. Including constraints, stored proc., AND the data, etc.

Now, with v2008, the wizard is dumbed down too much. It's a "stupid" copy function that fails on the first constraint it meets.

"Copy database.." is not an option here: it needs sysadmin on both source and destination server.

Re-adding the constraints manually is not an option either: the database is WAY too large. 

I'm actually hoping there is a temporary bug in the import/export wizard. Each option (and you have THREE...) returns with a new error.

Googling, I found I am not alone:


This post is exactly my situation. Here's what his post says: (bolded key parts)


I'm trying to get used to sql server 2008 having been forced to upgrade by my isp. I need to back up my key db on a weekly remote schedule, so have been trying to use ssms to export data from my remote db to a local copy.

Firstly I created a new empty db on the local machine. Then I scripted the structure of the db on the remote machine and ran the resulting query on the local machin

error when logout my web page

sir i am usinng ajax roundcorners toolkit but when i logout my web page error occuers . error is:- Microsoft JScript runtime error: Sys.ArgumentTypeException: Object of type 'AjaxControlToolkit.RoundedCornersBehavior' cannot be converted to type 'AjaxControlToolkit.RoundedCornersBehavior'. Parameter name: instance

ModelStateDictionary problems - Summary not completely correct

In my Controller's constructor - I have a service where i create a Validator class that uses the ModelState and ModelStateDictionary.For some reason, the error under the summary and the Html.ValidationMessage does not show up correctly for some reason...Here is my View:<% using (Html.BeginForm()) { %> <%= Html.ValidationSummary(true, "Manage Organization unsuccessful. Please correct the errors and try again.") %> <table> <tr> <td><%=Html.Encode("Name:")%></td><td><%=Html.TextBoxFor(m => Model.Name, new { style = "width:500px;" })%><%= Html.ValidationMessage("OrganizationName", "*") %></td> </tr> <tr> <td><%=Html.Encode("Move Under:")%></td><td><%=Html.TextBoxFor(m => m.NewParentName, new { style = "width:500px;" })%> <%= Html.ValidationMessage("OrganizationMove", "*") %></td> </tr> <%=Html.HiddenFor(m => m.ParentId)%> </table> <% } >My Controller:public OrganizationManageController() { //...more services OrganizationManageService(_organizatio

How to check if a Control partially or completely obscured by other windows

In  http://social.msdn.microsoft.com/Forums/en-US/netfxbcl/thread/78289886-f3c1-405b-aaa1-722a23690245 is described how to test if a Window is obscured by other windows. Is there a way to do this wit a single control ?  Using the  GetOverlappedIntersection from the example dosent work. ? I'am not very good in Win32... but Controls implement IWin32Window also - Wht is the difference to Forms ? Thank you

logout coding

i hv a default.aspx page that ask for username and password. i maintain a session["uname"]  on the clikc of submit button.now on submit click i am redrtng to new page default1.aspx that have a logout link button. wat coding should i do on the click of logout so that i m not rediretct back to default1.aspx on pressing back buton of browser.

CustomError Mod Logs redirects me to Logout

I have a bug in which, whenever an error occurs the user seems to get logged out.  After much research I find that the situation is not so simple:(note I have dumbed these down a bit to make it easier to follow)Web.config - I turn on Custom Error Mode               <customErrors mode="On" defaultRedirect="ExceptionPage.aspx" >       <error statusCode="404" redirect="PageNotFound.aspx"/>     </customErrors >              <customErrors mode="On" defaultRedirect="ExceptionPage.aspx" >      <error statusCode="404" redirect="PageNotFound.aspx"/>    </customErrors >Global.asax - I save the Last Error so I can access it easily later on the error page    void Application_Error(object sender, EventArgs e)    {        Exception oEx;                oEx = HttpContext.Current.Server.GetLastError();                HttpContext.Current.Session["LastException"] = oEx;}ExceptionPage.aspx - Show a nice error message protected void Page_Load(object sender, EventArg

SQL Server 2008 Dev edition, from XP SP3 - says uninstalled completely, but not...

Despite what it says, not only did it not uninstall, the installation size, per "add or remove programs", increased by 700MB as a result of the uninstall.   Running the uninstall again... and again, no errors (so far). Anybody see anything like this?

logout action problem in IE

I have a login page and a default page to be redirected to after login. when I clicked on thew logout button in the default page it correctly redirects to login page. But when I click the back button in the IE I can again see the protected default page( in mozilla everythng is OK, no problem but in IE this problem occurs).Have I done something wrong. My code r below:login page===========protected void Login1_LoggedIn(object sender, EventArgs e)        {            if (Roles.IsUserInRole(Login1.UserName, "Members")) {               Response.Redirect("users/Member/default.aspx");                //Server.Transfer("users/Member/default.aspx",true);                        }        }===========default page has a LoginStatus button( logout action: RedirectToLoginPage)

logout problem(after logout when clicking on back button after logout still opens the previous page

I am using ASP.NET, the web page is abandoning and clear session when a user click logout link but they click the back button and it is still showing the previous page. How can it prevent the previous page after logout?on Logout.aspx load im using this code//=================//        Session.Clear();        Response.Buffer = true;        Response.ExpiresAbsolute = DateTime.Now.AddDays(-1D);        Response.Expires = -1500;        Response.CacheControl = "no-cache";        //----- Second Technique : To Stop Caching of Secure Pages.        Response.Cache.SetCacheability(HttpCacheability.NoCache);        FormsAuthentication.SignOut();        if (Session["UserName"] == null)        {            Response.Redirect("login.aspx");        }       Session.Clear();         Response.Buffer = true;         Response.ExpiresAbsolute = DateTime.Now.AddDays(-1D);         Response.Expires = -1500;         Response.CacheControl = "no-cac

Hiding rows/columns completely in SSRS tablix even when they have data

I have several columns and rows in my tablix.  I don't want to see all of them at once.  I am using a parameter that controls the visibility of the columns or rows of the tablix.  The issue is that it hides but the white space is left.  How do i take out that white space?

logout redirect



When I click the "Log out", I would like to convert to login.aspx page.

What do I do?


How to handle logout whent using loginstatus control



I am using form authentication in my application and Loginstatus is using to logout .

My problem is I want to store login and logout information to database.

Which event handler should i use to insert logout time to database.

Please help..

SQL Server Express 2008 idling user logout facility


please let me  know whether there is a  facility in SQL SERVER EXPRESS 2008 to logout idling users automatically.My problem here is that due to limited no of license other needy users can not log in to the system 


ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend