Contents

DateTimePicker.InvalidMonthAndDayAction Property

Notes

Gets or sets an InvalidMonthAndDayActionEnum enumeration indicating what action the control should do (on server side postback) if an invalid month and day combination ( Eg 31 April ) is posted by a user. Invalid dates can be posted if the user's browser is not Internet Explorer 5 or up.

This property has no effect unless both Month and Day are part of the current DisplayFormat.

The default value is ChangeToLastDayOfMonth. Note that this behaviour (ChangeToLastDayOfMonth) is the same as that performed by the client-side date validation.

By default 29 February is considered the last valid date in February if Year is not part of the DisplayFormat ( i.e. only Month and Day ).

InvalidMonthAndDayActionEnum Enumeration

Value Description
LeaveAsInvalid Does nothing if an invalid date is posted. HasValue will remain FALSE.
ChangeToLastDayOfMonth This option would for example change 31 April to 30 April. HasValue returns TRUE and Value can be accessed.
TreatAsDateSerial This option would for example change 31 April to 1 May. HasValue returns TRUE and Value  can be accessed.

Syntax

[Visual Basic]
Overridable Public Property InvalidMonthAndDayAction As InvalidMonthAndDayActionEnum
[C#]
public virtual InvalidMonthAndDayActionEnum InvalidMonthAndDayAction {get; set;}
[C++]
public: __property virtual InvalidMonthAndDayActionEnum get_InvalidMonthAndDayAction();
public: __property virtual void set_InvalidMonthAndDayAction(InvalidMonthAndDayActionEnum);
[JScript]
public function get InvalidMonthAndDayAction() : InvalidMonthAndDayActionEnum;
public function set InvalidMonthAndDayAction(InvalidMonthAndDayActionEnum);

See Also

DateTimePicker Contents | DateTimePicker Overview | DateTimePicker Members


Support | Feedback | Contact Dune5 | Website

© 2001-2003 Dune5. All Rights Reserved.