• .NET Mobile

    Demystifying unexpected redirects to login page in ASP.NET

    January 11, 2013 Share
    Have you often configured the authorization settings of your website to specify areas with special access rules? One of the common scenarios is to create a website that should be available only to authenticated users. When doing this, have you ever run into the strange behavior of a login page life cycle being executed multiple times when the access to all pages is denied for anonymous users? Read on to see why this happens and how you can avoid it with only a few changes in the web.config file of your website.
  • .NET Mobile

    Tip of the day - Modal Dialogs

    December 02, 2008 Share
    When we have a running application and we want to show a modal dialog window what we generally do is more or less the following: var window = new MyDialogWindow(); window.ShowDialog();   Doing that works great - the dialog window shows and is modal. It has just one tiny defect - if you switch from the running application to another one (i. e. using Alt + Tab) and then come back to the running app the modal dialog window is not showing and the app is inactive. The solution - just assign the parent window to the Owner property of your modal dialog window :  var window = new MyDialogWindow(); window.Owner = this;  window.ShowDialog(); ...