Specifying DataFunc (js function) instead of Url, if DataFunc is specified, Url is ignored.
Besides data the js function can also return a promise which will return the data later.
Cascading
Load from server first time only
The first time this url is requested it will be loaded from the server and stored in sessionStorage after that all subsequent request will get the data from the session storage.
CacheGetFunc is a util extension in this demo and will render a call to cstorg.get (cstorg.js).
<div class="example"> <h2>Load from server first time only</h2> @Html.Awe().AjaxRadioList("CatCached1").Url(Url.Action("GetCategories", "Data")).Ochk() @Html.Awe().AjaxRadioList("CatCached2").Url(Url.Action("GetCategories", "Data")).Ochk() <div class="expl"> The first time this url is requested it will be loaded from the server and stored in sessionStorage after that all subsequent request will get the data from the session storage. <code>CacheGetFunc</code> is a util extension in this demo and will render a call to <code>cstorg.get</code> (cstorg.js). </div> </div>
<script> var categories = @Html.Raw(DemoUtils.Encode(categories)); var meals = @Html.Raw(DemoUtils.Encode(meals));