//public ActionResult Index(Guid id) //{ // if (id != null) // { // UpdateList(); // SurveyViewModel s = listSurvey.Find(l => l.Id == id); // if (s != null) // { // IsPreview = false; // ViewBag.Survey = id; // } // } // return View(); //} //-------------------------ajax called------------------------ public JsonResult Initialization(string id) { List <QuestionViewModel> q = new List <QuestionViewModel>(); AccountController.ClearRespondent(); AccountController.ClearQuestionAnswer(); var questions = db.Questions.Where(x => x.SurveyId == new Guid(id)).ToList(); if (questions != null) { foreach (var item in questions) { q.Add(new QuestionViewModel(item)); } foreach (var item in q) { item.GetAnimateViewList(); item.GetQuestionAnswerViewList(); } } return(Json(q.OrderBy(x => x.Number), JsonRequestBehavior.AllowGet)); }