(I work in asp.net)
I’m looking for a way to have a div with a jquery.toggle ( plus/less button)
the content of the div need to load only when the div is visible (need to be hide on page load).
Did I “NEED” to have a page with the content of my div
Or I can use an updatepanel inside the div. And call the panel to load his content.
I dont wnat my page to reload because I have multiple block div, in the page, that can be loaded if the user want it. and each of them have too many data inside.
Any tips,
tank you
I will regularly use ajax to load such content from a webservice or a pagemethod (which is actually a webservice…)
when the expansion icon (+) is clicked the service is called, data is returned (as JSON) and then applied to a template which was loaded inside a hidden div when the the page was loaded and inserted into a div that was toggled to visible on the click event…
If this matches your needs, great; if not, please be more specific what you are trying to accomplish.
[Edit: code sample as requested]
The click event of the Expansion Icon fires this JavaScript:
When you invoke
PageMethods.LoadCategoryItems...this should be a typical ajax call to send back the content into another JavaScript function:This function will identify and copy the template for the category of data being displayed and find and replace data tokens with actual values from JSON.