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
Bryan Gomez
NA
21
36.8k
Filter table based from dropdown - dataset
Nov 27 2017 12:37 AM
I have a partialview for my table, I want that every time the dropdown is changed the table will refresh acording to the dataset record. But having an error of
Synchronous XMLHttpRequest on the main thread
is
deprecated because of its detrimental effects to the end user’s experience. For more help http:
//xhr.spec.whatwg.org/
It appears when I added this script:
$(
"#txtCategory"
).change(
function
() {
var
value = (
this
).value
$(
"#tblAssessment"
).load(
'@Url.Action("getcategory", "assessment")/'
+ value);
});
In my controller assessment:
public
ActionResult GetCategory(
string
ID)
{
dynamic model =
new
ExpandoObject();
var serviceentry =
new
wmssoft_srm.Models.ServiceEntryFields();
model = serviceentry;
#region "getqacategory"
model.GetQA = GetQACategory(ID);
#endregion
return
View(
"_assessment"
, model);
}
private
List<wmssoft_srm.Models.ServiceQACategory> GetQACategory(
string
category =
""
)
{
WMSSOFT_WCF_Service.WMSSOFT_InterfaceClient wmsSR =
new
WMSSOFT_WCF_Service.WMSSOFT_InterfaceClient();
DataSet dsl =
new
DataSet();
DataSet dsO =
new
DataSet();
string
a =
"ValidateCredentials"
;
string
b = category.ToString() +
"~~"
;
//b = wmsSR.fCallWMSSOFTService(a, null, ref dsl, ref dsO);
b = wmsSR.fCallWMSSOFTService(
"GetSRMQuestionsByCategory"
, b,
ref
dsl,
ref
dsO);
if
(b ==
"OK ~~"
)
{
if
(dsO.Tables[0].Rows.Count >= 0)
{
DataTable oDT =
new
DataTable();
oDT = dsO.Tables[0];
wmssoft_srm.Models.ServiceEntry slData =
new
Models.ServiceEntry();
var myList = slData.GetQACategory(oDT);
return
myList;
}
}
return
null
;
}
}
And for my Model:
public
List<ServiceQACategory> GetQACategory(DataTable oDT)
{
List<ServiceQACategory> slData =
new
List<ServiceQACategory>();
for
(
int
i = 0; i < oDT.Rows.Count; i++)
{
ServiceQACategory sl =
new
ServiceQACategory();
sl.questionId = Convert.ToInt32(oDT.Rows[i][
"QID"
].ToString().Trim());
sl.question = oDT.Rows[i][
"QUESTION"
].ToString().Trim();
slData.Add(sl);
}
return
slData;
}
}
public
class
ServiceQACategory
{
public
int
questionId {
get
;
set
; }
public
string
question {
get
;
set
; }
}
Thanks
Reply
Answers (
1
)
How to get unread files from folder using asp.net and VB.net
How to add path dynamically in asp.net?