04-10-2023, 04:36 AM
(This post was last modified: 04-10-2023, 04:39 AM by Alexandre Machado.)
In case A:
1) It works fine because IW is designed to handle this case.
2) It works fine eventually. In your case it works. In other cases it may not work, so don't use it
3) assets/myjs/myjs.min.js is also another case that it may or may not work fine. It really depends on the folder structure. I'd not use it either
In case B:
1 and 2) When you add files to ContentFiles list, they are pre-processed before rendering. The URL base is added to the file path, if they are relative paths, based on their type (i.e. extension). CSS files will definitely receive the URL base. So they work the same because IW is designed to handle these cases as well.
So, in short:
If you are using relative URL addresses in your template files, use case (A-1)
If you are adding files to the ContentFiles list of your IWForm, use either B-1 or B-2, they should both work.
Another case not covered here is, for instance, image files. If you are using IWImageFile (or any other control that has an image file reference property) use '\the-wwwroot-subfolder\the-image-filename.png'. It will always work regardless of the project type.
Hope it clears your doubts
1) It works fine because IW is designed to handle this case.
2) It works fine eventually. In your case it works. In other cases it may not work, so don't use it
3) assets/myjs/myjs.min.js is also another case that it may or may not work fine. It really depends on the folder structure. I'd not use it either
In case B:
1 and 2) When you add files to ContentFiles list, they are pre-processed before rendering. The URL base is added to the file path, if they are relative paths, based on their type (i.e. extension). CSS files will definitely receive the URL base. So they work the same because IW is designed to handle these cases as well.
So, in short:
If you are using relative URL addresses in your template files, use case (A-1)
If you are adding files to the ContentFiles list of your IWForm, use either B-1 or B-2, they should both work.
Another case not covered here is, for instance, image files. If you are using IWImageFile (or any other control that has an image file reference property) use '\the-wwwroot-subfolder\the-image-filename.png'. It will always work regardless of the project type.
Hope it clears your doubts

