By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,738 Members | 1,480 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,738 IT Pros & Developers. It's quick & easy.

Todays date in range validator?

P: n/a
Hi everyone, i have a range validator set to date mode. However, I want the
max date to be whatever it is right now, is there a way of setting this
within the properties of the range validator?

Thanks,
Taz
Feb 21 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Of course. You can set any property you want programmatically. All you need
to know is the string that goes into RangeValidator.Maximim which is
compatible with its Type property. (Type=Date in this case.)

In Page_Load, use:

RangeValidator1.Maximum = DateTime.Today.ToShortDateString()

--- Peter Blum
www.PeterBlum.com
Email: PL****@PeterBlum.com
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx

"Tarun Mistry" <no****@nospam.com> wrote in message
news:O9**************@TK2MSFTNGP09.phx.gbl...
Hi everyone, i have a range validator set to date mode. However, I want
the max date to be whatever it is right now, is there a way of setting
this within the properties of the range validator?

Thanks,
Taz

Feb 22 '06 #2

P: n/a
Peter, many thanks for solving this issue!

Kind regards,
Tarun

"Peter Blum" <PL****@Blum.info> wrote in message
news:uy*************@TK2MSFTNGP15.phx.gbl...
Of course. You can set any property you want programmatically. All you
need to know is the string that goes into RangeValidator.Maximim which is
compatible with its Type property. (Type=Date in this case.)

In Page_Load, use:

RangeValidator1.Maximum = DateTime.Today.ToShortDateString()

--- Peter Blum
www.PeterBlum.com
Email: PL****@PeterBlum.com
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx

"Tarun Mistry" <no****@nospam.com> wrote in message
news:O9**************@TK2MSFTNGP09.phx.gbl...
Hi everyone, i have a range validator set to date mode. However, I want
the max date to be whatever it is right now, is there a way of setting
this within the properties of the range validator?

Thanks,
Taz


Feb 22 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.