If you guys haven’t seen this terrific jQuery Watermark Plugin go check it out over here.
I just installed it today and found a nice way to watermark all my input boxes by a neat jQuery .each() trick. If you’ve used this plugin but got a bit annoyed having to invoke the watermark and set the contents in JavaScript for each one, give this a shot.
JavaScript:
// Scan and set a watermark for every matching input element and set with 'watermark' flag
$(document).ready(function() {
$('input').each(function() {
$(this).watermark($(this).attr('watermark'));
});
});
Html:
<input type="text" id="name" watermark="Full Name" />
<input type="text" id="city" watermark="City or Suburb" />
The JS will iterate through all input controls on your page (the above example being two), and set the watermark text to that which you have specified in a custom attribute named “watermark”. Pretty easy and cuts down code.
Great plugin, cheers Todd.
VN:F [1.4.3_701]
Rating: 0.0/5 (0 votes cast)
I just wanted to do a “refresher” post regarding ASP.NET MVC validation as many things have changed over the last couple of months and there is a lot of information out there. I wanted to aggregate my known validation options and recommend them in one tabular list. Whilst I’m scared to write “best practice” now a days, I do believe that the below list is really worthwhile, and are the most prominent and reputable on the net, and one in particular, the xVal framework I am using in a real-world project with absolutely no hassles and no apparant drawbacks. However, I write that disclaimer as there is always something else out there
. So without further ado, Ill get to the list, which is hopefully simple and easy to follow.
I hope this list can help alleviate any confusion amongst anyone not sure on the best path to go down, or at least provide a good starting point for those of you new to ASP.NET MVC and a validation strategy.
WHAT I RECOMMEND:
xVal + if you need client-side “ajax” validation calls, Adrian Grigores’ RemotePropertyValidator API which snaps right on to xVal.
* IF YOU CHOOSE XVAL (GREAT!):
Are you using LINQ to SQL and wish to declare your validation rules via .NET Data Annotations attributes? If so, click here.
(This outlines how to get this working so L2S re-generation doesn’t interfere with your property attributes for your model.)
If anyone has seen my older validation articles you’ll notice I had an Emad Ibrahim “validation hybrid”, but since xVal came along this is my framework of choice and also Emad’s didn’t support Linq to Sql.
If you have any others, comment and I’ll post them for others.
VN:F [1.4.3_701]
Rating: 5.0/5 (3 votes cast)
Here we go, brace yourself for a spam of links.
Unbeknowns to me as a resultant of being super busy, I had not recently checked out the ADO.NET and EFDesign blog, but looks like those guys have been going flat out pumping lots of great content regarding the new Entity Framework 4.0 currently in Beta 1 which sounds very promising.
I personally am really interested in the new POCO and pluralisation support and the “Model Only”/“Code Only” features.
I have listed these articles in chronological order, oldest to newest, start from where you find interesting, or start at the top as it’s the first article I could find where EF 4.0 was announced and always good to get that initial background. (by the way, it seems although a lot of content exists on EFDesign’s blog, most of it is linked respectively from each ADO.NET blog article which is good).
That’s pretty much it to date, so I don’t think you’ll be out of the loop if you read all of that. If you would like to learn more about EF 4.0 or new and upcoming ADO.NET features in general, make sure you check out both these blogs (ADO.NET and EFDesign) for tons more great content!
VN:F [1.4.3_701]
Rating: 0.0/5 (0 votes cast)
Just a quick note to say source code formatting has been fixed!
Horray(); // !!!
VN:F [1.4.3_701]
Rating: 0.0/5 (0 votes cast)
Sorry folks, particularly to my Google Chrome readers who would have experienced difficulty while browsing my site today. It seems my site is throwing up an incorrect message regarding embedded malware and stating my site as unsafe for browsing.

After investigation and moderate freaking out I have tracked the problem down to being within the DropBox service I use (I shouldn’t really honour them the traffic! But it really isn’t their fault, but they could have better monitoring practices.) and particularly, the domain dl.getdropbox.com and a wildcard URL from it being blacklisted by Google’s servers. I quite frequently reference DropBox on this blog and I just happened to be caught in the crossfire it seems.
The message appears on any URL hit under a member’s account on DropBox I’ve worked out, at first I thought it was just mine but as you can see, changing the Member ID on dl.dropbox.com results in the same error:
Mine:

Random User:

I use the DropBox service to synchronise files in the cloud between PC’s and to serve you guys a load of content including code samples and screenshots, it seems in doing so and having links pointing to these HTTP-accessible files somebody else using the DropBox service has managed to blacklist us resulting in this alarming error! Very frustrating!
So NO MORE DROPBOX FOR ME. I will commence moving all images, source code and all other links from my DropBox location onto goneale.com directly enabling me hopefully to not fall victim to this again which was simply caused by some unscrupulous user’s malware-infested DropBox account.
I’m not sure how long the changes will take to propagate and for Google to realise I no longer host DropBox links, so hang in there (should be <1 day) and again I appreciate if you were a Google Chrome user and you trusted my site enough to click through to read this message =:)
I repeat, this is a false message and please do not be alarmed!
VN:F [1.4.3_701]
Rating: 0.0/5 (0 votes cast)