Showing posts with label C#. Show all posts
Showing posts with label C#. Show all posts

Thursday, January 16, 2014

Redirect and the ThreadAbort exception

Tired of getting the ThreadAbort exception when you have the Common Language Runtime Exceptions enabled? Then do it properly using the following code:

Response.Redirect(url, false);
Context.ApplicationInstance.CompleteRequest();

Enjoy!

Monday, January 17, 2011

Redirecting any unauthenticated requests to a login form located on another asp.net application

If you have configured forms authentication across multiple asp.net applications, you may want to force users to authenticate in a single signing form. To do so you may implement a simple HttpModule that will be handling the AuthenticateRequest and redirecting to the corresponding login form.

Thursday, January 13, 2011

Asp.net HTTP module to force authenticate user via Basic WWW-Authenticate dialogue

Playing around with the available authentication methods I came up with a simple Http module that forces the browser to display the build in credentials form and authenticates the user by simply adding a line in the web.config file.