Rendering subcategories on click in asp.net mvc3 -


i new mvc3, developing first project in mvc3. have left side bar filled top categories. on click of top category, want display sub categories under clicked category. subcategories can @ no of level.

  • how go it?
  • should use partial views?

on click of category, first have check if has subcategory, if yes render sub categories.

i think best option here use ajax , dynamic load of data.

on javascript code bind click event of first level nodes ajax call method on server.

this method should: check if node has children, if has return list of children associated it, if hasn't should return info adverting client code it.

your ajax call on success should check if receive list of subnodes or message adverting there's no subnodes. if has subnodes append them html structure, if hasn't nothing (or whatever want when clicking on top node without children).

from here can make system grow in complexity as want, using different methods different node levels , behaviours, etc...


Comments

Popular posts from this blog

php - Why I am getting the Error "Commands out of sync; you can't run this command now" -

linux - Does gcc have any options to add version info in ELF binary file? -

java - Are there any classes that implement javax.persistence.Parameter<T>? -