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
Raju Fodse
1.5k
244
31.2k
Json Result with Date Parameters
Jul 27 2017 6:53 AM
In MVC and want create dynamic DropDown which is depending upon Date Filed. How Can I Write Code for Json and use same in View
I write following Json Code
public
JsonResult GetAttnList(
string
ProductionDate)
{
Response.CacheControl =
"no-cache"
;
LPDBContext DB =
new
LPDBContext();
List<Atten> AtnList = db.Attens.Where(x => x.ATTNDATE.ToShortDateString().Equals(ProductionDate)).ToList();
return
Json(AtnList, JsonRequestBehavior.AllowGet);
}
View Code is
$(
"#PRDate"
).change(function () {
$.
get
(
"/Dailyproduction/GetAttnList"
, { ProductionDate: $(
"#PRDate"
).val() }, function (data) {
$(
"#ATTNSYSID"
).empty();
$.each(data, function (index, row) {
$(
"#ATTNSYSID"
).append(
"<option value='"
+ row.ATTNSYSID +
"'>"
+ row.EmpName +
"</option>"
)
});
Reply
Answers (
3
)
why it is getting public virtual int function() in mvc
Double quotes problem