1

I am currently using FormFactory (http://formfactory.apphb.com/) to dynamically generate forms for me. This generally works well except for when rending my custom field types which require certain JavaScript files.

What I would like to do is dynamically add JavaScript references to the page depending on what Editor templates have been rendered by FormFactory.

At the moment I am having to reference all JavaScript libraries regardless of whether they are being used. Is there a better way of doing this to ensure that I don't reference libraries which aren't being used?

Edit: Yes, I could add the reference into the EditorFor template, however this would duplicate references if the same template is used more than once.

Thanks

StrictlySocial
  • 697
  • 2
  • 10
  • 19

1 Answers1

0

After I realized this also applies to Partial views it was easy to find an answer.

Using sections in Editor/Display templates

Community
  • 1
  • 1
StrictlySocial
  • 697
  • 2
  • 10
  • 19