While this post actually has nothing to do with ASP.NET MVC directly, the only common denominator is that I came up with this technique while working on the platform.
To be a true 1:1 copy of the previous website I would be converting to ASP.NET MVC, I had to come up with a way to reintroduce the <blink>
tag to XHTML. While you are perfectly able to use <blink>
it doesn't actually do any blinking in IE8 or Firefox. To show that properly, jQuery comes to the rescue.
The technique is really pretty simple:
<div id="#alertheader">
)setInterval(function() {
jQuery.each(jQuery.browser, function(i) {
if ($.browser.msie) {
$('#alertheader').css({ opacity: '0' }).stop().animate({ opacity: '1' }, "fast", "swing");
}
if ($.browser.mozilla) {
$('#alertheader').stop().animate({ opacity: '1' }, "fast", "swing");
}
});
}, 600);
You should hopefully notice the caveat I ran into immediately. IE and Firefox animate their opacity changes differently so it required special handling. An easy exercise for the reader would be to optimize this code to remove the IE/Mozilla check during the setInterval call.
You can achieve similar results by using a series of .fadeOut(x).fadeIn(x) calls but I had to make sure the sum of all calls didn't become less than the setInterval "loop" or it would blink wildly. The other problem it introduces is when text "fades" it can often look weird in either browser if you use a relatively fast interval. This became a headache very early on.
While I can't take whole credit for the technique, the primary Stack Overflow problem that got me started can be found here: https://stackoverflow.com/questions/1375646/jquery-animate-opacity-doesnt-work-properly-on-ie. In the post the user Eric states that jQuery should handle the opacity support for you. It does. For some reason to produce output I felt was adequate, no one definition would work across both browsers.
Most of this may or may not be relevant to your situation but after completing development, staging, and most of the production implementation of an ASP.NET MVC site I wanted to share some of what I learned.
The majority are one or two-off hacks from someone else's code or a down/upgrade where appropriate, creating a Frankenstein. These won't necessarily be in order I don't think.
Elmah
ELMAH_LogError
stored procedure to SQL 2000ELMAH_LogError
pruning taken from 2 blog posts from a single sourcejQuery uses
Areas
SQL 2000 from 2005
MsBuild scripts - dependency chaining, SqlPubWiz integration via Community Tasks, etc.
I'll try to refer to this verbatim as my defacto outline and even that isn't quite structured correctly enough. It'll work itself out as the posts are made I'm sure. I'm using this to hopefully keep me motivated to completing them all.