.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Extending the Datata Annotation RangeAttribute

Posted By:      Posted Date: September 02, 2010    Points: 0   Category :ASP.Net
Has anyone extended the Range attribute to be able to have a variable range?I have a similar need but I can't make this work:    public class YearRangeAttribute : RangeAttribute        {            public YearRangeAttribute()                : base(typeof(DateTime), DateTime.Now.AddYears(-100).Year.ToString(), DateTime.Now.AddYears(-14).Year.ToString()) { }            }There is nothing on the page when it is rendered to the browser and the code above doesn't work. Any ideas?TIA

View Complete Post

More Related Resource Links

XPS, the WPF Document Viewer and extending the WPF Annotation framework


Hi all,

I'm in the design phase of a project at the moment and the client wants a desktop app they can use to view and annotate "any" type of document. I've been doing some research into the WPF document viewer and XPS documents and it seems like a perfect fit because using the XPS document writer, you can print anything to an xps document and easily view it in your WPF app. I've tested this with a few different document types (PDF, web pages, word documents, etc etc) and the results have been very impressive. I wanted to stay away from the Adobe PDF reviewing tool, because dealing with their APIs is likely to be difficult and I wanted to design an all-MS solution if possible.


Another major advantage of XPS is that we can use the WPF annotation framework (System.Windows.Annotations), but my problem is that this framework is a good start, but the client is going to want richer features that the framework doesn't provide, like the following:


·         Ability to draw rectangles o

Business Modelling and Web Applications and extending UML

UML can be used to model a business, prior to automating it with computers. The same basic UML syntax is used, however, a number of new symbols are added, in order to make the diagrams more relevant to the business process world. A commonly-used set of these symbols is available in current versions of Rational Rose.

Beyond MVP: Extending the MVP Pattern to Simplify UI Architecture


MVP has become a dominant pattern for UI design, but there are many interpretations of how to implement MVP. We take a look at some MVP-extending pattern and pull them into a holistic view of UI architecture.

Haozhe Ma

MSDN Magazine February 2010

Toolbox: Easy Web Debugging, Extending Reflector, and More


This month, a better design-time experience for Web apps, Scott Guthrie's blog, extending Extend Lutz Roeder's Reflector, and more.

Scott Mitchell

MSDN Magazine March 2008

Service Station: Extending WCF with Custom Behaviors


WCF extensibility points allow you to customize the process by which messages are translated, formatted, and sent over the wire for more customized services.

Aaron Skonnard

MSDN Magazine December 2007

Foundations: Extending the WPF Animation Classes


Learn what the WPF Animation Classes can do, what they can't, and how to extend them.

Charles Petzold

MSDN Magazine July 2007

Extending SDL: Documenting And Evaluating The Security Guarantees Of Your Apps


In this article, the author presents an extension to the Security Development Lifecycle Which could promote a better flow of information between users and designers of software security features.

Mark Novak

MSDN Magazine November 2006

Cutting Edge: Extending the GridView Control


Welcome to my100th consecutive installment of Cutting Edge. I've been writing this column since January 1998 in Microsoft Internet Developer. Looking back over the past eight years, I realize that I've touched on almost every subject in the Windows® SDK and the Microsoft® .

Dino Esposito

MSDN Magazine May 2006

CLR Inside Out: Extending System.Diagnostics


The System. Diagnostics namespace in the Microsoft® . NET Framework contains powerful tracing capabilities. This includes the main tracing API: TraceSource. As you will see, the tracing APIs in System.

Krzysztof Cwalina

MSDN Magazine April 2006

More Windows 2000 UI Goodies: Extending Explorer Views by Customizing Hypertext Template Files


The Web-style interface is the default Explorer folder view for the Desktop Update in Windows 2000. The Desktop Update uses HTML-based hypertext templates to create the Web view, and you can customize these templates to include your own views and commands. This article shows you how the Explorer Web view works and how to build your own custom templates for it. You'll see how to add a command prompt and task buttons to a new folder view using HTML, script, and ActiveX controls. The shell object model and thumbnail shell extensions are also examined, then used to build a simple icon viewer for Explorer.

Dino Esposito

MSDN Magazine June 2000

Extending Role/Membership


Given an organization site, here is what we need to accomplish:

  1. Administer Role/Membership completely on specific pages of the remotely hosted site instead of using a local site within Visual Studio.
  2. Create and add region group, city group or other groups in addition to the basic user group. How can the new groups be stored and administered?
  3. After users login the 1st time, their Role/Membership are saved so that they will be redirected to their own designated page upon future login. Are we going to use cookies and/or tables to store related data?

Please advise how to best implement the above with samples and/or tutorials.

Thanks much in advance.

extending a class and conversion

Public Class Person Property FirstName as String Property LastName as string End Class 'student is a person but we add Grade as property Public Class Student    Inherits Person Property Grade as String End Class There is a function that loads persons from the database. dim lstPersons as List Of(Person) = getListOfPersons() I have a function defined in Student namespace/class, these objects are different. function LoopThroughStudents(lstStudents as List Of(Student)) ''''' looping ''''' end function To this last function instead of lstStudents I want to pass lstPersons. Is anyway lstPersons can be converted into List Of (Students) and keep the value of the persons ? Public Class Person Property FirstName as String Property LastName as string End Class 'student is a person but we have added Grade as property Public Class Student Inherits Person Property Grade as String End ClassThere is a function that loads persons from the database.dim lstPersons as List Of(Person) = getListOfPersons()I have a function defined in Student namespace/class, these objects are different.function LoopThroughStudents(lstStudents as List Of(Student)) ''''' looping ''''' end functionTo this last function instead of lstStudents I want to pass lstPersons. Is anyway lstPersons can be c

Best Practices for extending an Open Source project

I am beginning an implementation and customization of an open source e-commerce application (nopCommerce).  I'm looking for any for any suggestions and / or recommendations to annotate or document any source code changes I would make in order to allow for the easiest integration of new versions of the application that are released. I do have TFS 2010 implemented but I do not have much experience with the product.  I tried to merge the source of a new release but ran into some difficulty, especially when files were deleted from the project. For much of the project I can copy existing user controls and create custom versions for my use, but there will be some modification of the actual source code required. Anyone have any suggestions? Thanks in advance.  

Data Annotation not triggering the client side validation when used on an overriden model property

Hi all, This is a saga from a post that was recently answered:http://forums.asp.net/t/1598187.aspxMy main problem is the lack of client side validation when we use a child model class, the server side validation works like a charm whether you use the virtual/override solution or the new attribute on the child class with the getter and setter linking the property to the base class's one.The client side validation does not work with none of the solutions presented below.This is a sample code of the first solution: [Serializable] public class DateViewModel { ... [Display(typeof(App_GlobalResources.Messages), "Date_Year")] public virtual int? Year { get; set; } ... } [Serializable] public class BirthDateViewModel : DateViewModel { ... [Display(typeof(App_GlobalResources.Messages), "Date_Year")] [YearRange(ErrorMessageResourceType = typeof(App_GlobalResources.Messages), ErrorMessageResourceName = "Validation_Range")] public override int? Year { get; set; } ... } This is a code sample of the second solution : [Serializable] public class DateViewModel { ... [Display(typeof(App_GlobalResources.Messages), "Date_Year")] public int? Year { get; set; } ... } [Serializable] public class BirthDateViewModel : DateViewMod
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend