Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
3
Reply
Json Result with Date Parameters
Raju Fodse
Jul 27 2017 6:53 AM
179
Reply
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>"
)
});
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
3
)
Next Recommended Forum
why it is getting public virtual int function() in mvc
Double quotes problem