Solved

ASP.NET date range validation

Posted on 2007-03-31
3
1,360 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
  • 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 500 total points
ID: 18838387
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

760 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now