Take an ASP.NET Application offline with HttpModules

by Arnold Matusz 2 9 2009

Whenever you do maintenance work on a website it is advisable to show the visitors a nice message telling them politely to come back later, rather than a nasty error, or even worse: a big Yellow Screen of Death.

Since ASP.NET 2.0 came out of the labs of Microsoft, there is a way to take a web application down using the “app_offline.htm” approach. You simply create a HTM file, which you then upload to the server, and if there is any request to this web application, IIS will automatically show the contents of the app_offline.htm file. Once uploaded, most people only rename the file so that it doesn't catch up with IIS anymore, and the site is already back online. » Continue reading ...

ASP.NET Menu with jQuery Superfish

by Arnold Matusz 9 8 2009

Choosing the right type of menu for a website is not easy at all. The ASP.NET Menu Control is definitely NOT a good starting point due to the horrendous markup it renders, nor is it good for SEO because of the Markup/Content ratio, neither can it be easily styled.

Of course there is the CSSFriendly Control Adapters project that started back in 2006, which made the the ASP.NET Menu (and many other ghastly markup rendering controls) render beautiful <div> based markup. In the case of the Menu it rendered <div> and <ul>-<li> type markup which is probably the most widely spread technique used for creating menus known to mankind. » Continue reading ...

ASP.NET Membership – Show list of users online

by Arnold Matusz 13 7 2009

The .NET Framework 2.0+ comes with a set of functionality for easily building security enforced web applications mainly with the ASP.NET Membership API and the Security web controls. The Membership class has most of the feature one would need with user management, and because it is based on a Provider Model you can write a provider for any Database you wish.

While working on an intranet application I often faced the following situation. Several people were online, logged in, when I needed to upload a new version of the web application. Because I personally know all the people who have access to this application it’s important for me to see who is online so I can announce them before taking the application down and uploading a new version. » Continue reading ...

LINQ Distinct, Except, Contains, Union, Intersect and IEqualityComparer

by Arnold Matusz 23 6 2009

LINQ is one feature I could not live without anymore. It is always a pain to work on projects using older technologies. The gap between .NET 1.1 (VS.NET 2003) and .NET 2.0 (VS.NET 2005) was huge and it was difficult to develop anything in ASP.NET v1.1 after you got your hands on .NET 2.0. But the gap between .NET 3.5 SP1 coupled with Visual Studio 2008 and the prior version is far bigger.

There is LINQ, LINQ to SQL, Lambda Expressions, the Entity Framework (and allot more) which simply boost your development speed. Anyone who hasn’t tried these yet: you definitely need to have a go! » Continue reading ...

call JavaScript - jQuery code from ASP.NET Server-Side

by Arnold Matusz 3 6 2009

jQuery got so close to me lately that I can see myself adding the scripts to my project almost unconsciously. The thing is, jQuery is very useful for me, in almost all situations and it has been a do or die enhancement for all my project since I first put my hands on it.

Of course while using it, you encounter few situations which need a bit of research to solve, mostly when you are trying to combine it with some other technologies like: UpdatePanels and ASP.NET Ajax. For instance there are many situations when I would like to run some jQuery magic based on some decision that I make on the server side. » Continue reading ...

jQuery UI DatePicker instead of AJAX Control Toolkit CalendarExtender in ASP.NET

by Arnold Matusz 4 5 2009

When the ASP.NET Ajax Control Toolkit first came out with the CalendarExtender, I just loved it. That smooth transition when navigating from month to month or year to year really won me over. I’ve also loved how I could use it as a simple ASP.NET Control by integrating it in my pages and using from my code-behind.

I took a look at the jQuery UI DatePicker widget (from an ASP.NET Developers point of view), which again completely won me over. What was it this time? Well … the speed, the options, the themes, the frequent updates, the ease of integration, etc. » Continue reading ...

When computer science takes a break

by Arnold Matusz 2 5 2009

It’s a long time since I’ve last been out for a little photo shooting. It’s probably not the photography that is so desirable, I think it’s more the fact that I get to disconnect from all the daily matters, from programming, from all the new information that arises daily from nowhere.

I never seem to get tired, I always feel like I have enough reserve to do anything. I never feel I need to get a good sleep or that I would like to do something else. I always feel good in my little world of … hmm, there would be too many to enumerate here. Anyway I always feel myself occupied with keeping up with the latest technologies, the latest trends, programming languages and techniques, etc. » Continue reading ...

jQuery and ASP.NET first steps

by Arnold Matusz 26 4 2009

This post may be most relevant to those who haven’t had the chance to work with jQuery yet. Lately there is a great hype around jQuery, very many people talk about it, very many write excellent example but most of them target more advanced users.

jQuery is a lightweight (~19KB Minified and Gzipped) JavaScript library which easily enables us to traverse the DOM (Document Object Model), handle events, animate elements, and do asynchronous requests (AJAX – Asynchronous JavaScript and XML). » Continue reading ...

Firebug Lite for IE, Google Chrome, Opera, Safari

by Arnold Matusz 7 4 2009

I’ve been using Firefox for quite allot of time now, and I got used to many extensions I could not live without in the day to day development life. Firebug is one of these. When somebody told me: You can’t call yourself a web developer unless you have Firebug installed, I thought this was a bit to hard. But after I faced many situations where Firebug was the definitive tool, I really think everybody should use it.

I often have to do some work on websites in other browsers (Ex: IE – eeeek I know). This is when I really feel I like and I miss Firebug. I really love to see how asynchronous requests are performing (network monitor), I really love how you can inspect and edit DOM elements, I really love to edit the DOM on the fly and see the effects instantaneously, I really love to edit the CSS on the fly and see the effects, you guessed it: instantaneously. I also love that it has got a JavaScript Console where I can test my jQuery magic on the fly. Then there is the fact that it logs JavaScript errors and I also need to mention I love that I can debug JavaScript with it. » Continue reading ...

jQuery live() and ASP.NET Ajax asynchronous postback

by Arnold Matusz 25 3 2009

In my last post I blogged about how jQuery $(document).ready() and ASP.NET Ajax asynchronous postbacks can be made to behave well together. The issue is that normally $(document).ready() is called when the DOM is ready to be manipulated. But this doens’t happen after an ASP.NET Ajax asynch postback occurs.

This means that the initial jQuery bindings won’t be automatically available after the asynchronous postback is over. I underline “automatically” here because my last post describes more possibilities, how this issue can be worked around. » Continue reading ...