TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
malak laghoz
NA
66
6.3k
How to display full date DD/MM/YYYY
Jun 25 2018 6:34 AM
hello please I have application in aspnet mvc
my model is
[Range(1, 31, ErrorMessage = "Date between 1 to 31")]
public int? Day
{
get; set;
}
[Range(1, 12, ErrorMessage = "Month between 1 to 12")]
public int Month
{
get; set;
}
public int Year
{
get; set;
}
public bool isFullBirthDay { get; set; }
and this my controller
if (data.isFullBirthDay)
{
if (!data.Day.HasValue)
{
ModelState.AddModelError("Day", "Please enter day value");
return View(oPost);
}
else
{
if (data.Day.HasValue && (data.Day.Value < 1 || data.Day.Value > 31))
{
ModelState.AddModelError("Day", "Please enter day value");
return View(oPost);
}
}
if (data.Month < 1 || data.Month > 12)
{
ModelState.AddModelError("Month", "Please enter proper month");
return View(oPost);
}
//check for leap year
}
else
{
if (data.Month < 1 || data.Month > 12)
{
ModelState.AddModelError("Month", "Please enter proper month");
return View(oPost);
}
}
my need is how display in date DD/MM/YYYY
in view because I have this fields separate
Reply
Answers (
3
)
Tutorial for begginer asp.net MVC
GridView Bulk Update using check box selection