ASP.net
Awesome
Learn
Forum
Buy
Demos
Sign In
☾
☀
Switch to
Dark
Light
Mode
this site works best with javascript enabled
Ask Question
Prevent initial call to load items
Title:
B
I
{code}
?
Hi, is there any way to prevent the initial call to load items for an AjaxCheckboxList? Thanks in advance
Save Changes
Cancel
PDMDSUI
asked at 18 Feb 2014
you can't prevent the call, but you can control the data that is being returned (for example return an empty list when there's no parent value), why do you need this ?
at 18 Feb 2014
Omu
because I have to do some calculations before the list could be filled. I can trigger the reload process again, but sometimes the initial reload process is slower then the second one and the wrong data is displayed.
at 18 Feb 2014
PDMDSUI
you can set a parameter .Parameter("dontLoad", 1) so on the server you return an empty list initially, and after call the api with a parameter that will tell the server to ignore the first one. what calculations are you doing ? can't they be made at the server ?
at 18 Feb 2014
Omu
Ok thx. How could I set this Parameter ("dontLoad") to 0?
at 19 Feb 2014
PDMDSUI
@Html.Awe().AjaxDropdownFor(o => o.Meal).Parameter("dontload", 0) (http://aspnetawesome.com/learn/mvc/general)
at 19 Feb 2014
Omu
OK, was question was wrong. How could I change this parameter after creation? Something like: $('#mealDropDown').setParameter("dontload", 0);?
at 19 Feb 2014
PDMDSUI
using the api or by looking at the parent value; you're doing calculations how are you using the result of the calculation to influence the AjaxCheckboxList ?
at 19 Feb 2014
Omu
Answers
please
Sign In
to leave an answer
By accessing this site, you agree to store cookies on your device and disclose information in accordance with our
cookie policy
and
privacy policy
.
OK