thebeebs | September 2009
thebeebs
Zeroing the desk - Ignore the design
 
 

New X Val Released

by thebeebs 20. September 2009 01:32

xval The new version of xVal is out and it now has dynamic client-side validation summaries and can validate remotely using Ajax. For those that don’t know xVal is a validation engine for MVC that can validate user input not only on the server but also on the client. It means you can write your validation rules once, in one place and you’ll get the benefit throughout your application.

My personal preference for validation is to use data annotations. These are simple annotations that you decorate a class with to instruct frameworks the validation required by each property of your class, xVal reads these annotations and creates the JavaScript required to validate the properties on the client side.

For example the below example stipulates that we must have a title and it must have a certain length, the director and the Box-office total is also required.

using System.ComponentModel.DataAnnotations;

namespace Sample

{
public class Movie

{

public int Id { get; set; }

[Required(ErrorMessage="Movie title is required.")]
[StringLength(8, ErrorMessage="Movie title cannot be longer than 8 characters")]
public string Title { get; set; }

[Required(ErrorMessage="Movie director is required")]
public string Director { get; set; }

[Required(ErrorMessage="Box office totals is required")]
public decimal? BoxOfficeTotals { get; set; }

}
}

I’ll download the xVal demo project today and write up a step by step example. So watch this space.

Tags:

Review: Test Freaks

by thebeebs 17. September 2009 06:01

Test Freaks Logo Earlier in the month I was asked to take a look at the new test freaks website. Test freaks aggregates product information, expert and user reviews into a single user interface much like cnet, price runner or which.

 

On first impressions the layout looked good, some really subtle eye candy and a great deal of attention has been paid to design detail, like the nice score element and the embossed effect given to the search bar.

 

Score Element, great attention to detailSearch box, lovely gradiant embossed effect.

 

Beta LogoI have an axe to grind about the beta logo, it seems every web 2.0 company insists on adding this. It’s like going to work with a sign around your neck saying “Partially Incompetent” In my opinion either a site is ready for the world or it’s not. By adding beta people seem to be making excuses for why things are breaking and if things are breaking… it shouldn’t be live. Hey but I'll forgive them its like Harry Potter and Ecstasy Pills; all the kids are doing it.

 

I love the way the search bar on the first page works, after entering a partial keyword an Ajax query is fired off which provides a JSON result of product matches on the left and category matches on the right, it’s a really subtle but interesting play on the Google suggest textbox. The close search results button at the bottom of the screen should disable the auto suggest feature but other than that it’s really well implemented.

 

Ajax Search

If you click through to a product category you get a nice compare feature, the design is good, to compare it takes a while to respond though giving you the impression that it didn’t work and it’s also not working in IE8, I think there could be a little Jquery Tweaking to make it a little more responsive, but 10 out of ten for the button design, very sleek.

 

Product category listing

 

 

 

 

The product view is well designed, all the information about the product is to hand and the video/Image links are tucked away nicely, I'm not quite sure if there is much point to the less grades/ More grades button to the bottom left of the image, I suspect they will be adding a great deal more of these grades and want to ensure that only the really important ones are visible, but at the moment when you only have 1 extra grade it seems a little redundant.

 

Product Listing 

All together the site is excellent and the background work that goes into the aggregation must have been pretty painful. Ultimately I think the site serves it’s purpose well and provides users with a simple interface to interrogate product information at a really granular level. They just need to lose that beta image.

Tags:

Question: System.Web.Mail missing

by thebeebs 14. September 2009 06:14

 

Question:

I just ported some code from 2.0 to 3.5 and it’s now saying SmtpServer Isn’t a valid type.

 

Answer:

You should use SmtpClient and Mail message from the System.Net.Mail namespace rather than SmtpServer and MailMessage from the System.Web.Mail namespace.

 

emailClient

 

You can also set up your SMTP Client  in the config file:

 

image

Tags: