I need an advice.
(For those who have already read this before I re-edited this question)
I have developed some asp.net mvc web pages.
On each page there is a wizard and some ascx controls (between 2-6), a js and css file built into it.
So far, everything was in order.
In order to increase modularity, flexibility, and testability, ascx is expected to work as standalone controls.
(Each ascx also has its own css and js files, in some cases it has a different control inside it)
To satisfy this requirement, we invoke the controller using the query string.
(Unlike how it is called from the page - via Ajax)
The submitted ascx is (partially) presented in the browser without all the other parts of the original page.
In this case, for the partial display (css) to display correctly and for the correct action (js / jquery), all the necessary files must be added (for example: jquery) to the user control.
This contradicts the concept of positioning files in the most logical place (for example, it may be the main page).
How can I solve this problem? Keep in mind that this is true for each "control" ascx file created in the application.
Examples:I added a description of 3 cases that my script will display:(this was copied from another question that I asked here ).Case 1: In the case of a page, it may be that there are several partial files on the page that are loaded using ajax during page creation. Partial can be called again using ajax in accordance with user actions. In this case, I consider them as controls on the page.
Case 2: In a particular case, a part may be called as part of a test directly from the browser. In this case, you see only a partial part in the browser.
Case 3: In the third case, the partial can be called as part of the iframe in the google chrome extension (for example). In this case, you can see a partial on a page that would not be built in your web application.
Any thoughts would be appreciated.For those who celebrate - Happy New Year!