![]() |
Platforms, Frameworks & Libraries »
.NET Framework »
General
Beginner
License: The Code Project Open License (CPOL)
Dynamic validation according to logged in userBy Shivprasad koiralaDynamic validation according to logged in user |
C# (C# 1.0, C# 2.0, C# 3.0), .NET (.NET 1.0, .NET 1.1, .NET 2.0, DotGNU, .NET 3.0, .NET 3.5), ASP.NET, ADO.NET, WCF, WPF, Ajax, Architect
|
||||||||||||
|
Advanced Search |
|
|
|
||||||||||||||||
Many times we want certain set of validation to fire for some user and certain set of validation to fire for some other user. In the section we will see how we can achieve the same using Microsoft enterprise validation blocks.
I have been writing and recording videos on architecture, design patterns, UML, enterprise blocks etc. You can view all my videos on http://www.questpond.com. Any feedbacks do email me at shiv_koirala@yahoo.com
Validation application blocks: - This article explains the 16 steps you need to perform to do validations using VAB.Validation application blocks
Client side validation: - One of the short comings in VAB is that it does only server side validations. This article talks how we can leverage VAB for client side.Client side validation
Policy Application blocks: - This article talks how to implement plug and play mechanism using Policy application blocks.Policy application block
Logging application block: - This article explains the 5 basic steps of how to use logging application blocks.
Logging application block
Data application: - This article talks about the four steps you need to implement data application blocks.
Data application block
Exception application block: - This application talks how we can use exception application blocks to log exception from project.Exception application block
Unity application block: - This application talks about Unity Application Block in DI and IOC.
Unity application block
UIP block: - This article talks about Reusable Navigation and workflow for both Windows and Web using Microsoft UIP blocks.UIP block
There are times when you want validation according to the logged in user or customer. For instance in the below figure you can see we want different validation for both user. For one user we want that the customer code should be minimum 2 characters while for the other user we want it to be 5 characters.
Figure: - Logged in user
Enterprise library helps us to solve this problem like a charm. To understand this article you need to once read basics of how to implement validation using VAB ( validation application blocks ). In case you are not aware of the basics you can read the same from my previous article http://www.codeproject.com/KB/aspnet/Questpond.aspx .
To fire validation according to logged in user is a two step process.
Step 1
First you need to define two different rule set according to customer. For instance you can see in the below figure we have defined two validation. The first validation checks if the customer code is minimum two length while the second validation checks if the customer code is five length.
Step 2:- In step 2 we just need to call the validation according to user logged in using the “Validation” static class. The validate function of the validation static class have two parameters one is the customer object and the other is the rule name. So depending on logged in customer you can fire the rules on fly.
| You must Sign In to use this message board. | ||||||||||||||||||||||
|
||||||||||||||||||||||
|
||||||||||||||||||||||
|
||||||||||||||||||||||
|
||||||||||||||||||||||
General
News
Question
Answer
Joke
Rant
Admin
|
PermaLink |
Privacy |
Terms of Use
Last Updated: 18 Mar 2009 Editor: |
Copyright 2008 by Shivprasad koirala Everything else Copyright © CodeProject, 1999-2009 Web12 | Advertise on the Code Project |