I would like to store some user inputs into a cookie on the client side. Using MVC3/Razor. Data entered into several DropDownLists. Examople of one below:
<div style="float: left;">
@Html.Telerik().DropDownList()
.Name("name").BindTo((SelectList)@ViewBag.Filter1SelectList)
.Placeholder("All")
.ClientEvents(events => events
.OnChange("onChangeFilter1"))
</div>
I created the following JavaScript in an attempt to store values as the dropdown values change.
function onChangeFilter1(e) {
var filter1 = document.getElementById('name').value;
'<%= ViewData["Filter1Value"]%>' = filter1.toString();
}
The idea is to gather several filters from multiple dropdownlists. Data is filtered on submit button. Is this even possible? I saw only one example and copied it carefully but the above errors: Microsoft JScript runtime error: Cannot assign to '[string]'.