ASP.net
Awesome
Learn
Forum
Buy
Demos
Sign In
☾
☀
Switch to
Dark
Light
Mode
this site works best with javascript enabled
Ask Question
Prevent Awesome Controls calling controller on page load
Title:
B
I
{code}
?
HI, Can i prevent the ajaxcheckboxlist from calling the controller when the page is loaded? i want to manually trigger the load on each ajaxcheckboxlist.
Save Changes
Cancel
warlok
asked at 11 Aug 2016
try adding .Load(false)
at 11 Aug 2016
Omu
That didnt solve my problem: Problem: i have 4 checkboxlist's and My application open a database session to get data and closes it on completion of each request to populate the checkboxlist. For some reason this is not working, before the request for one checkboxlist is completed its try to load the other checkboxlist which is causing issue with session and when the page loads only few checkboxlist's are populated.
at 11 Aug 2016
warlok
http://aspnetawesome.com/learn/mvc/CommonProblems#Isolate-the-problem
at 11 Aug 2016
Omu
here is the link to the project https://asasrohitponaka.sharefile.com/d-s5b976f07bb54b0fa that i created using mvcminsetupi have created a view QuestionView and upon loading the page you can see the output in visual studio.problem is when the first checkbox data is processing the other check boxes also processes simultaneously . In this application: Each controller method writes the names of the method in the output several times before returning the result. If you see the output it is clear that it is not synchronous.
at 12 Aug 2016
warlok
the only problem I saw here is that you didn't call json.stringify on selected items before setting jquery .val(string) ; so you it should be like this: var selectedItems = JSON.stringify(["First"]); $('#Mult').val(selectedItems).data('api').render(); also I don't know why you need this and .Load(false) does work; and you can call api.load() later as for the requests, that's how ajax works, it's async, you need to fix your data layer you can simulate the same by using 2 ajax requests that call the Db
at 12 Aug 2016
Omu
I was able to solve my problem using the DataFunc and in javascript method making an ajax call with async:false. My environment is different i can have only one database session open at a time which was causing issue. Anyways thanks for your help.
at 12 Aug 2016
warlok
you could make the server queue the data requests, or pool the "session"
at 12 Aug 2016
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