Model Validation

P

Pavel Minaev

I am working on validating my model and I was looking on Net 3.5
DataAnnotations:http://msdn.microsoft.com/en-us/library/system.componentmodel.dataann...

They seem to not cover a lot of validation situations ... Am I wrong?
Are there extra validations?

I'm not familiar with that namespace, but at the top of MSDN page,
there is this statement:

"The System.ComponentModel.DataAnnotations namespace provides
attribute classes that are used to define metadata for ASP.NET Dynamic
Data controls."

Now, ASP.NET Dynamic Data is a fairly specific technology (you can
search for it), so I'm not sure if those are at all useful for your
own classes in an ASP.NET MVC project.

(By the way, when you're asking a question, it's always worth
clarifying the technology you're working with. Even when speaking of
stock .NET technologies, a "model" can be present in a WinForms app,
WPF app, Silverlight app, plain ASP.NET, and ASP.NET MVC. All of these
can have radically different ways of doing things, including
validation).
I also know there are the Castle Validators. Is this an independent
project?

Yes, it is. I cannot say much apart from that - specifically, I do not
know if their validators are specific to their web framework
(MonoRail), or not.
I can't find any download link for this ...

Castle Project lives here:

http://www.castleproject.org/
What other validation approaches can you suggest me?

Well, a quick Google search for "ASP.NET MVC validation" gives this as
a first hit:

http://mvcvalidatortoolkit.codeplex.com/Wiki/View.aspx
 
S

shapper

"The System.ComponentModel.DataAnnotations namespace provides
attribute classes that are used to define metadata for ASP.NET Dynamic
Data controls."

It is also being used in ASP.NET MVC 1.0 ...
I found them through some MVC Application examples ...
(By the way, when you're asking a question, it's always worth
clarifying the technology you're working with. Even when speaking of
stock .NET technologies, a "model" can be present in a WinForms app,
WPF app, Silverlight app, plain ASP.NET, and ASP.NET MVC. All of these
can have radically different ways of doing things, including
validation).

I didn't mentioned because I wanted to know how it is done, even in
other technologies.
In MVC there are a few different ways to do it ...
But most of them still have some problems so I was looking in how it
is done in other areas of .NET.
Yes, it is. I cannot say much apart from that - specifically, I do not
know if their validators are specific to their web framework
(MonoRail), or not.

It can be used in .NET ... I am not sure if I will use it.
I prefer to not use many exterior tools because sometimes they stop
begin developed.

I don't know why but in all my searches I was getting into a page that
not that one. Thanks.
Well, a quick Google search for "ASP.NET MVC validation" gives this as
a first hit:

http://mvcvalidatortoolkit.codeplex.com/Wiki/View.aspx

Yes, I know most of MVC validation projects.
I was looking on other NET technologies validation to get an idea of
the different approaches.

Probably I will been using the following (It seems interesting):
http://blog.codeville.net/category/xval/
http://xval.codeplex.com/

Thanks,
Miguel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top