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
Guest User
Tech Writer
2.1k
473.7k
System.Linq.Dynamic.ParseException: Expression expected
Feb 11 2020 7:36 AM
Hi Mate
I am encountering this issue, below "System.Linq.Dyanmic.ParseException:Expression expected". I am doing server side processing using DataTable. This comes from my Controller object GetList() method.
// using System.Linq.Dynamic;
[HttpPost]
public
ActionResult GetList() {
//Server side Parameter.
int
start = Convert.ToInt32(Request[
"start"
]);
int
length = Convert.ToInt32(Request[
"length"
]);
string
searchValue = Request[
"search[value]"
];
string
sortColumnName = Request[
"columns["
+ Request[
"order[0][column]"
] +
"][name]"
];
string
sortDirection = Request[
"order[0] [dir]"
];
List < TblEventsManagements > empList =
new
List < TblEventsManagements > ();
using
(eNtsaOnlineRegistrationDBContext db =
new
eNtsaOnlineRegistrationDBContext()) {
empList = db.TblEventsManagements.ToList < TblEventsManagements > ();
int
totalrows = empList.Count;
if
(!
string
.IsNullOrEmpty(searchValue)) {
empList = empList.Where(x => x.TrainingType.ToLower().Contains(searchValue.ToLower()) || x.TrainingDescription.ToLower().Contains(searchValue.ToLower()) || x.Price.ToString().Contains(searchValue.ToLower()) ||
x.Venue.ToLower().Contains(searchValue.ToLower()) || x.Facilitator.ToLower().Contains(searchValue.ToLower()) || x.WhoAttend.ToLower().Contains(searchValue.ToLower()) || x.Rsvp.ToLower().Contains(searchValue.ToLower())).ToList < TblEventsManagements > ();
}
int
totalrowsafterfiltering = empList.Count;
empList = empList.OrderBy(sortColumnName +
" "
+ sortDirection).ToList < TblEventsManagements > ();
// This throws at here on this line. System.Linq.Dyanmic.ExpressionParse.ParsePrimaryStart();
empList = empList.Skip(start).Take(length).ToList < TblEventsManagements > ();
return
Json(
new
{
data = empList, draw = Request[
"draw"
], recordsTotal = totalrows, recordsFiltered = totalrowsafterfiltering
}, JsonRequestBehavior.AllowGet);
}
}
$(document).ready(function() {
$(
"#EventManagementTable"
).DataTable({
"ajax"
: {
"url"
:
"/Dashboard/GetList"
,
"type"
:
"POST"
,
"datatype"
:
"json"
},
"columns"
: [{
"data"
:
"TrainingType"
,
"trainingtype"
:
"TrainingType"
},
{
"data"
:
"TrainingDescription"
,
"name"
:
"TrainingDescription"
},
{
"data"
:
"Price"
,
"name"
:
"Price"
},
{
"data"
:
"Venue"
,
"name"
:
"Venue"
},
{
"data"
:
"Facilitator"
,
"name"
:
"Facilitator"
},
{
"data"
:
"WhoAttend"
,
"name"
:
"WhoAttend"
},
{
"data"
:
"RSVP"
,
"name"
:
"RSVP"
},
],
"serverSide"
:
"true"
,
"order"
: [0,
"asc"
],
"processing"
:
"true"
,
"language"
: {
"processing"
:
"processing... please wait"
}
});
});
Reply
Answers (
4
)
Uncaught Typeerror $(...).fullCalendar is not a function
Element, Id Changed