"When it comes to prevalidating your inputs, Javascript is significantly more efficient than trips back to the server."
I agreed to that several posts ago. It is also much more efficient to use the built-in .Net Validators, which, by default, write client side Javascript, thus still saving the trip to the server, while also saving me from having to write the JavaScript myself. That was my original point, and I apologize...
User Profile
Collapse
-
It's not a question of "getting my hands dirty with JavaScript", it's a question of efficiency. I won't write JavaScript unless .Net can't do what I need. In the case of the original problem on this thread, VS Validators write client side JavaScript for me, so it is a waste of time to write that JavaScript myself. In the more complex scenario I described, the advantage of hand rolled JavaScript will not be significant unless I have a...Leave a comment:
-
Personally, I never write JavaScript if I don't have to. In this case, two lines of .Net code behind covers the problem of validating a date range based on the current date completely.
Don't sell the built in Validators short, they are quite powerful. The only case where I can see value in writing JavaScript for client side validation in a .Net web application would be if the required range changed based on the values entered in other...Leave a comment:
-
Again, why javascript?
VS 2008 validators, by default, run on client side. VS writes the javascript for you.Leave a comment:
-
You've got to be kidding...
Javascript? Why are you coding in .Net?
I realize it is too late for the original poster, but put this code in your PageLoad() event :
Code:RangeValidator1.MaximumValue = DateTime.Now.AddDays(90).ToShortDateString(); RangeValidator1.MinimumValue = DateTime.Now.AddDays(-5).ToShortDateString();
Last edited by Frinavale; May 13 '10, 07:23 PM. Reason: Please post code in [code] ... [/code] tags. Add code tags.Leave a comment:
No activity results to display
Show More
Leave a comment: