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

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

Range validator broken in MVC 3 Beta 1?

Posted By:      Posted Date: October 07, 2010    Points: 0   Category :ASP.Net

This was all working in MVC3 RC1 (I think MVC2). With the upgrade these are broken.

 I've switched ClientValidationEnabled and Unobtrusive = false, as I couldn't get these to work.



Range(0, 999, ErrorMessage = "Numbers only")


[Range(typeof(decimal), "0.0", "100.00", ErrorMessage="Not a margin number 0.0 - 100.00!")]






View Complete Post

More Related Resource Links

Compare validator /Range validator does not work while using localization



I have a requirement of converting existing english form to multi lingual form.I am currently converting english form to spanish form.

Everything works except the date formats.

The range validator is not working in a spanish form but works in a english form.

I have set the maximum and minimum value in page load as below in the english form

Heres how i have set the values

rndateval.MinimumValue = DateTime.Now.AddYears(-50).ToShortDateString();

rndateval.MaximumValue = DateTime.Now.AddDays(20).ToShortDateString();

But the range validator does not work

Please help me in resolving the issue .

ASP.NET 4 and Visual Studio 2010 Web Development Beta 2 Overview

Many exciting changes for ASP.NET are coming in the .NET Framework version 4. This document gives an overview of many of the new features that are included in the Beta 2 release of the .NET Framework 4 and of Visual Studio 2010.

Visual Studio 2010 Beta 2

This is a big deal. This isn't ".NET 3.6" - there are a lot of improvements of .NET 4, and it's not just "pile on a bunch of features so you get overwhelmed." I've been working with and talking to many of the teams involved and even though it's a cheesy thing to say, this is a really customer-focused release.

ASP 4 - Whirlwind Tour around .NET 4 (and Visual Studio 2010) Beta 1

There's a lot of stuff that's new and added in .NET 4, but not in that "overwhelming-I-need-to-relearn-everything" way. More in that, "oh, this is way easier/simpler now" way. Like, moving data around with ADO.NET DataServices is easy, binding with client templates is easy, there's F# if you need it, the "dynamic" keyword if you need it, Silverlight's already installed, oh, and the parallel stuff will freak you out, but in a good way.

ListViewControl - how to group items by their value, for eg. date range



I have a table containing courses, columns are 

Name - "Yoga Classes"

DateStart - "2/23/2010"

DateEnd - "2/24/2010"

I am using ListView Control to bind it, is there a way to display them and group them by Month? 

for eg.


Piano Class (10th Jan 2010 - 11th Jan 2010)
Guitar Class (10th Jan 2010 - 11th Jan 2010)


Yoga Class (15th Feb 2010 - 16th Feb 2010)

Thanks for help.

Validator code keeling over


I'm posting in this forum, as it seems the best place for looking at some horrible Javascript!  In essence, I'm trying to hook into a RangeValidator on the client side - nothing special, just asking it to revalidate.  So, I have this in my VB:

 objDescriptor.AddProperty("DateRangeValidator", rvDateInput.ClientID)

and this in my JS: 

// First the constructor
this._DateRangeValidator = null; 

// Then the prototype
get_DateRangeValidator: function () {
        return this._DateRangeValidator;

    set_DateRangeValidator: function (value) {
        this._DateRangeValidator = value;


That's no different from many of the other references I am passing around, and which all work.  So, I'd expect this:


to "just work" and re-evaluate the validity - I think!  What I am actually seeing is:

function ValidatorUpdateDisplay(val) {
    if (typeof(v

System.DateTime.AddDays: Value to add was out of range.


I'm getting the following error:

[ArgumentOutOfRangeException: Value to add was out of range.
Parameter name: value]
   System.DateTime.Add(Double value, Int32 scale) +7657639
   System.DateTime.AddDays(Double value) +19

The line from which this error originates has the following code:

expires = Now.AddDays(30)

It occurs irregularly and irreproducably. The server date/time is correct and set to GMT. I've heard that it could be some curiosity to do with timezones, but that is speculative.

It seems that we're some time from the year 10,000 yet, so I can't understand why adding thirty days to the current time could cause this! Any ideas? Culture settings perhaps?

Service Station: Developing .NET Web Services with Beta 2


Version 2. 0 of the Microsoft® . NET Framework makes numerous improvements at various levels in the Web services protocol stack. In addition, better tool support and an increased focus on interoperability make your life easier.

Aaron Skonnard

MSDN Magazine April 2005

.NET Migration Case Study: Using ASP.NET to Build the beta.visualstudio.net Web Site


When the Web site used to collect customer feedback about the Visual Studio .NET beta needed an update, the Visual Studio team saw a good opportunity to implement, deploy, and showcase a real-world site using .NET technologies. This article covers the migration of the Web site, beta.visualstudio.net, from components written in Visual Basic 6.0 and ASP hosted on Microsoft Internet Information Services (IIS) 5.0 to ASP.NET and the .NET Framework. The choices of technologies to be incorporated, along with issues such as validation, security, and authentication, are all discussed. Both existing components and the new components written in JScript and ASP.NET that were used to migrate the site are also explained.

Jay Schmelzer

MSDN Magazine September 2001

How i find out light and dark color range??



I am showing preview of text in text box.

But if text color is light(Like white) and i want to show that text preview than text is not visible because textbox background color is white.

Can i get the range of dark and light color so i'll change textbox backgroun color accordingly.

Thanks in advance.

Outline doesn't appear around the Validator Callout Extender's callout


For some reaon the black outline isn't appearing around my Validator Callout Extender's callout box.  I don't have a css class set.  It should display a yellow callout with a black outline.  Like on the sample page: http://www.asp.net/ajax/ajaxcontroltoolkit/samples/ValidatorCallout/ValidatorCallout.aspx .

 It shows the yellow call out with the black outline around the pointed part but not the main box.  Any idea's on why this is happening?

V1.1 to Beta 2 - Namespaces Not Recognized


We are attempting to test out a website written in VS2003/.Net 1.1 in VS2005 Beta 2/.Net 2.0.  Our main problem at this point is that certain classes are not being recognized when they are referenced in other files not in the same directory as the class file.


A Framework.cs file under \Applications is inherited by several other webpages. It resides under the namespace Company.WebSite.Applications.

Another class, SearchHistories, is in \Applications\CrackHistory directory. The namespace of SearchHistories class is Company.WebSite.Applications.CrackHistory. SearchHistories inherits Framework.  Under .NET1.1, there was no problem with this. However, in VS2003, a compile error states "The type or namespace name 'Framework' could not be found (are you missing a using directive or an assembly reference?) C:\WEB\Applications\CrackHistory\SearchHistories.aspx.cs".

The immediate solution is to copy the Framework.cs file from the Applications directory and copy it into the Applications\CrackHistory directory. Then the error goes away. What is up with that?

Login control is suddenly broken in IE7 but works perfectly on Firefox (It works on both browsers lo


Hey Guys,

 I'm new around and I thought this is probably the best place to help me solve my dilemma, I am developing a website for almost a year now and the login control was implemented a logn time ago, however all of a sudden it will not authenticate on Internet Explorer 7 when the application is published, it doesn't even provide a message that authentication was unseccssful or throws any error, it just refreshes the same page. however this problem doesn't occure when I try the same website on FireFox 2.0...Also when I run the page locally on Cassini it work great on both browsers...This is one of the weirdest errors I have ever faced. what could have gone wrong on the server side to cause this? knowing nothing changed on the server-side...I'll provide a snapshot of the login control below

<asp:Login ID="LoginControl" runat="server" BackColor="Trans

Calculated Columns in a Form Library receive error: Value does not fall within the expected range.


I have a forms library that posts the date the form was created. We would like to create a calculated column that allows us to look at these forms based on the month and year they were created. I had created a calculated column that extracts the month and replaces the number with a text string by using an if statement; "IF(MONTH([Proposal Date])=1,"January","") It goes on to evaluate each month and replace the number with the text string. This formula worked for quite some time, though now when I try to add any calculated columns or edit any existing calculated columns on this form library I receive the following error: Value does not fall within the expected range. Now my existing calculated columns (like the one above) do not work and I can not create new calcualted columns. Any insight would be awesome as this has been plaguing me for a couple of months now.

Microsoft SharePoint Designer 2010 Beta (32-bit) - Now Available!

Using SharePoint 2010 Designer, advanced users and developers alike can rapidly create SharePoint solutions in response to business needs. In addition, developers can use SharePoint Designer 2010 to get a quick start on SharePoint development projects.

Microsoft SharePoint Designer 2010 Beta (64-bit) - Now Available!

Using SharePoint 2010 Designer, advanced users and developers alike can rapidly create SharePoint solutions in response to business needs. In addition, developers can use SharePoint Designer 2010 to get a quick start on SharePoint development projects.
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