Displaying posts tagged with

“asp.net-mvc”

Validate max file size during upload in asp.net mvc

Just a quick sketch. Validation is done as an Attribute (DataAnotations way). public class FileAttribute : ValidationAttribute { public int MaxContentLength = int.MaxValue; public string[] AllowedFileExtensions; public string[] AllowedContentTypes; public override bool IsValid(object value) { var file = value as HttpPostedFileBase; //this should be handled by [Required] if (file == null) return true; if (file.ContentLength [...]

Share

Client side validation after Ajax Partial View result in ASP.NET MVC 3

Now, as ASP.NET MVC 3 beta was finally released I have decided to give it a try. The most exciting thing that I have noticed is implementation of an idea of so called Unobtrusive JavaScript. This is for both Ajax helpers and Client Validation. And I have to admit that I just love it. I [...]

Share

Getting ugly with BeginActionLink helper!

Have You ever had such a moment when the most stupid and trivial solution turns out to be the ONLY ONE that is logically suitable at the moment? When I had such a feeling today…. I am working on a module for one of huge web portals (not to mention which one). Part of that [...]

Share

ASP.NET MVC 2 Preview 1 released!

YES! YES! YES! Great news for all MVC lovers, check it out on Phil’s blog

Share