In my Asp.net MVC 5 application i currently have three modules and each module have it's own script files and style sheet files and there are some common scripts and style sheet files also, these are available to all the modules and even to entire application.
Currently i have one main div and i replace the entire html of that div with the opening module using jquery ajax and it's working fine, but in this way my modules state is not persistent means after opening second module if i open previously opened module it will be opened from it's initial state.
Now i want to persistent the state of each opened module. One approach in my mind is that i make three different empty div and replace the html of each respective module to it's own div and if any module's div is not empty then i just show that div and hide the remaining divs but in this way i think scripts and css files references of individual modules will not be removed when another module in opened.
Kindly please guide me how can i achieve that only currently opened module scripts and css files are referenced in the page and remaining files references are removed along with my html of each module is persistent.
Thanks in advance. :)
you can make three views for your three modules with their corresponding
scripts files now
render those view in your
main div, this way you can render your view in you
main div. you can add
main div file.