Reputation: 2527
I have a kendo modal containing multiple dropdown lists. They generally work properly but the issue is that whenever the modal is submitted, when it is reopened, it retains the values in each dropdown from the previous submission. The ddl's themselves are populated using lists stored in the ViewData dictionary. I tried to find a way to turn off caching for the dropdown lists, but there doesn't appear to be a method to call that does this.
@(Html.Kendo().Window()
.Name("addPopUp")
.Scrollable(false)
.Width(800)
.Height(300)
.Modal(true)
.Title("Add Report")
.Visible(false)
.Content(@<text>
<div>
<div class="addReports">
<div>
<label for="ddlAddReportCategory">List1:</label>
<br />
@(Html.Kendo().DropDownList()
.Name("List1")
.DataTextField("Text")
.DataValueField("Value")
.HtmlAttributes(new { style = "width:100%" })
.BindTo(ViewData["isma"] as IEnumerable<SelectListItem>)
)
</div>
<div>
<label for="ddlAddReportMonth">List2:</label>
<br />
@(Html.Kendo().DropDownList()
.Name("List2")
.DataTextField("Text")
.DataValueField("Value")
.HtmlAttributes(new { style = "width:100%" })
.BindTo(ViewData["aum"] as IEnumerable<SelectListItem>)
)
</div>
<div>
<label for="ddlAddReportYear">List3:</label>
<br />
@(Html.Kendo().DropDownList()
.Name("List3")
.DataTextField("Text")
.DataValueField("Value")
.HtmlAttributes(new { style = "width:100%" })
.BindTo(ViewData["perf"] as IEnumerable<SelectListItem>)
)
</div>
<div>
<label for="ddlAddReportYear">List4:</label>
<br />
@(Html.Kendo().DropDownList()
.Name("List4")
.DataTextField("Text")
.DataValueField("Value")
.HtmlAttributes(new { style = "width:100%" })
.BindTo(ViewData["fund"] as IEnumerable<SelectListItem>)
)
What is the correct way to ensure that the modal drop down lists don't retain their values after each submission?
Upvotes: 0
Views: 381
Reputation: 1669
There is no resetting functionality. Whenever the window opens, you have to select the desired values from the drop down.
Upvotes: 1