I see in a page I can use “appendTo: scripts” to add scripts to the parent _layout scripts. But if my page (say index.html) has a partial, and that partial also uses “appendTo: scripts” the script doesn’t get appended. Is there any way to accomplish what I want to accomplish? And while I’m on the subject of asking, if there is a way to do what I’m asking, is there a way to enforce a “just once…” scenario? Append the script to the parent, but only once! If the partial is used 4 times, only add the script once. One way I could see pulling this off is to set a variable on first add of the script and subsequent calls would be bypassed because the variable is already set. If this is possible, I’m not sure how to pull it off in the Web App framework.
It’s one of the reasons I loved the Spark View Engine over Razor. It’s multi-pass functionality allowed for nested views to enhance the calling view, like doing the above.