This question is locked. New answers and comments are not allowed.
I have two telerik controls on a form (one is ComboBox, one is Autocomplete). The form is for Adding a new student object. There are two buttons: Save, Save and New. Save and New posts to the Controller's save method, but instead of redirecting back to a list of existing students, it is meant to return the Add Student screen. I have the following code in the Controller action:
All non-Telerik controls are cleared as expected. However, the Telerik controls retain the values from the Student that was just added.
Here's one of the Telerik control's code:
[AcceptVerbs(HttpVerbs.Post)]public ActionResult AddStudent(StudentProfileDto student, int addAnother){ var teacher = SessionWrapper.GetTeacher(HttpContext); var model = new EditStudentModel { Teacher = teacher }; if (ModelState.IsValid) { AddStudentToTeacher(student); if (addAnother == 0) return RedirectToAction("StudentRoster"); ViewData = null; model.Student = new StudentProfileDto(); } else { model.Student = student; } return View(model);}All non-Telerik controls are cleared as expected. However, the Telerik controls retain the values from the Student that was just added.
Here's one of the Telerik control's code:
@{ Html.Telerik() .AutoCompleteFor(model => model.Student.TagString) .Encode(false) .BindTo(Model.Teacher.Tags) //.AutoFill(true) .HtmlAttributes(new { @class = "form-input" }) .HighlightFirstMatch(true) .Filterable(filtering => { filtering.FilterMode(AutoCompleteFilterMode.StartsWith); }) .Multiple(multi => { multi.Separator(",") .Enabled(true); }) .Render();}