Question

My cfimport works on the page, but I tried moving it to onRequestStart and it didn't work. Then I tried putting it in a cfinclude one folder down, and that didn't work. Does the cfimport have to be on the page itself?

Was it helpful?

Solution

Yes, the tags can only be used on the page where cfimport is used; from the documentation:

The cfimport tag must be on the page that uses the imported tags. For example, if you use a cfimport tag on a page that you include with the cfinclude call, you cannot use the imported tags on the page that has the cfinclude tag. Similarly, if you have a cfimport tag on your Application.cfm page, the imported tags are available on the Application.cfm page only, not on the other pages in the application. ColdFusion does not throw an error in these situations, but the imported tags do not run.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top