I've been tagged [This link opens in a new window]

Sending a value from a ColdFusion custom tag to a page

I'm quite embarrassed to admit this, but I only found out recently how to send a value from a ColdFusion custom tag back to the page that made the call to it in the first place. I suppose the reason for this was the fact that I have never had the need to send a value back to the caller page, but the other day I did need this and found it to be very simple.

All you need to do is set a caller. variable from within the custom tag like below:

<cfset caller.myvar="string">

Then within your page that called the custom tag simply look for #myvar# and this will return string.

This is all great, but there is a better, more future-proof way to do this and I found out about it at coldfusionjedi.com. Instead of me reiterating what Ray said, click here to read his article.

  • Del.icio.us [This link opens in a new window]
  • Digg [This link opens in a new window]
  • Technorati [This link opens in a new window]
  • Reddit [This link opens in a new window]
  • Stumble Upon [This link opens in a new window]
  • Furl [This link opens in a new window]