?
Solved

ASP.NET date range validation

Posted on 2007-03-31
3
Medium Priority
?
1,376 Views
Last Modified: 2012-06-21
In Page_Load() of a regular ASP.NET page the below code can be used for date range validation:
                 RangeValidator1.Maximum = DateTime.Today.ToShortDateString()

But how can that code be put  in a Formview's Edit or Insert Template for a range validator's MaximumValue=""?

Thanks
0
Comment
Question by:ksfok
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 1

Expert Comment

by:jroth-haj
ID: 18830057
Hello,
it's depending on the structure of the page.
mybe on page_load event the object in't yet available.
try an later event.
you also should use "findcontrol" to find the object RangeValidator1
0
 

Author Comment

by:ksfok
ID: 18830915
The following code:
Control myControl = FindControl("valHireDateRange");
generates:
The type or namespace name 'Control' could not be found (are you missing a using directive or an assembly reference?)

Please advise.
0
 
LVL 1

Accepted Solution

by:
jroth-haj earned 1000 total points
ID: 18838387
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have developed many web applications with asp & asp.net and to add and use a dropdownlist was always a very simple task, but with the new asp.net, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question