Category Archives: ASP.Net

ASP.Net: App_Offline.htm as a Maintenance Page

While Googling about, I came upon an oldy-but-goody, that apparently has been available since the release of ASP.Net 2.0: App_Offline.htm. An undocumented feature, you can copy a file called app_offline.htm into the root of your .Net website and the application … Continue reading

Posted in ASP.Net, IIS, MVC | Leave a comment

ASP.Net MVC: Partially Secured Sites / Switching from HTTPS back to HTTP

Most sites out there have some portions that should be only served via HTTPS, while the remainder can be HTTP, such as account pages and content pages respectively.  This is sometimes called a “partially secured site.” Starting with MVC 2, … Continue reading

Posted in ASP.Net, C#, MVC | 1 Comment

C#: String Extension to Replace Accented Characters

Have you ever wanted to replace “accented” characters in a string with their equivalent English character?  Here’s a string extension that replaces these diacritics within a string for C# 2.0 and up: public static string ReplaceDiacritics(this string source) { string … Continue reading

Posted in ASP.Net, C# | Leave a comment

JavaScript, UTF-8 Encoding: escape() vs. encodeURIComponent()

ASP.Net web applications default to UTF-8 encoding.  Now, if you are using JavaScript to create or change URLs, you might run into an issue with the way the function “escape()” encodes characters if you are handling the decoding in your … Continue reading

Posted in ASP.Net, C#, JavaScript | Leave a comment

Sys.WebForms.PageRequestManagerServerErrorException in FireFox with MSFT Ajax

If you encounter this error while navigating away from an AJAX-enabled page with a non-IE browser, you can silence it with the following JavaScript: if (!document.all) //non-ie { window.onbeforeunload = function() { Sys.WebForms.PageRequestManager.getInstance().add_endRequest(ignoreOnEndRequest); } } function ignoreOnEndRequest(sender, e) { err … Continue reading

Posted in ASP.Net, C#, FireFox, JavaScript | 1 Comment